Zooming Image/Picture in a Picture Box 
Author Message
 Zooming Image/Picture in a Picture Box

Hi,
Would like to know how to zoom in/out a image without changing the size of
the picture box.
Thanks in advance.

Best Regards,
Lillian



Sat, 25 May 2002 03:00:00 GMT  
 Zooming Image/Picture in a Picture Box
Use the Image Box, so that you may change the size of the ImageBox
without changing the size of the picture box.

Note that changing the size of the picture box does not Zoom in/out
an image.

Quote:

> Hi,
> Would like to know how to zoom in/out a image without changing the size
of
> the picture box.
> Thanks in advance.

> Best Regards,
> Lillian

--
Posted via CNET Help.com
http://www.help.com/


Sat, 25 May 2002 03:00:00 GMT  
 Zooming Image/Picture in a Picture Box


Quote:
>Hi,
>Would like to know how to zoom in/out a image without changing the size of
>the picture box.
>Thanks in advance.

>Best Regards,
>Lillian

I haven't used BitBlt but PaintPicture works!

Load a larger image into a picture buffer in the background and load
your source image area from that.

If you select a smaller source area from your invisible picture buffer
to paste into your destination area using larger coordinates for that, the
result is a stretched area.  Don't expect a non-pixellated area as on
tv and films, though unless your source image is very, very large
in the first place.

Richard.

-------------------------------------------------------------------------
For a visit to Hill House from the original horror film "The Haunting" look up
         Ettington Park Hotel near Stratford Upon Avon.
"No one comes any nearer than town!...In the dark!.....In the night!"



Sat, 25 May 2002 03:00:00 GMT  
 Zooming Image/Picture in a Picture Box
Dear Lillian,

You can use the Windows StretchBlt API to do that.

Declare the StretchBlt in your form
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x
As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal
hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As
Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long

Then on button click you can Zoomin  the image to double the size as
follows.
    lRtn = StretchBlt(Picture1.hdc, 0, 0, Picture1.ScaleWidth,
Picture1.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth / 2,
Picture1.ScaleHeight / 2, vbSrcCopy)

Regards,
Rocks



Quote:
> Hi,
> Would like to know how to zoom in/out a image without changing the size of
> the picture box.
> Thanks in advance.

> Best Regards,
> Lillian



Sun, 26 May 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Can Someone tell me how to Zoom inside an Image or Picture Box (VB5)

2. Zooming a Picture Box image

3. Image Disappears From Picture Box During Zoom

4. Just want to Zoom the Point Clicked in Picture or Image Control

5. HOw to ZOOM / Rotate Picture or Image ?

6. Picture zoom-in and zoom-out

7. zooming into a picture box

8. ZOOM: (picture box) scale how does it work

9. zooming in a picture box

10. zooming in picture box

11. Picture Box and Zoom

12. Zooming Picture Box?

 

 
Powered by phpBB® Forum Software