
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