Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: zoom image

104| Sun, 02 Dec 2007 02:23:00 GMT| ravi15481| Comments (7)
hi friends...how to give the zooming effect to an image in a picture box..what i wanna do is ...when i right click on a image. the image should start zooming. and stop as soon as the key up event fires.
thanx

Keywords & Tags: zoom, image, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/560727/
 
«« Prev - Next »» 7 helpful answers below.
You'd need to use strechblt API, or paintpicture method.

digitaierror | Mon, 03 Dec 2007 21:26:00 GMT |

Use the StretchBlt API call. I'm too tired to go into details right now, but this is the API you should use:

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

midgetsbro | Mon, 03 Dec 2007 21:27:00 GMT |

Oh yeah, there's stretchDIBits.

When you load the pixel info into a byte array, then use that API.

digitaierror | Mon, 03 Dec 2007 21:28:00 GMT |

thanx friends...can anyone give me an example....i want to use only one picture box. the source and destination is same.

ravi15481 | Mon, 03 Dec 2007 21:29:00 GMT |

use stretchblt

picture1.scalemode = 3
stretchblt picture1.hdc,-1,-1,picture1.scalewidth+2, picture1.scaleheight+2,picture1.hdc,0,0,picture1.scalewidth,picture1.scaleheight, vbsrccopy

digitaierror | Mon, 03 Dec 2007 21:30:00 GMT |

hi friends its is working very fine..but i can see the zoomed image only after i minimize and then maximize...i dont know what's the problem...can u help me find out what might be the problem..

ravi15481 | Mon, 03 Dec 2007 21:31:00 GMT |

picture1.refresh

digitaierror | Mon, 03 Dec 2007 21:32:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories