Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: Zoom Problem Again !

104| Thu, 29 Nov 2007 21:30:00 GMT| kinjalgp| Comments (3)
I am using the following code given by one of the VB WORLD.COM member to zoom a picture.

Dim speed As Integer
speed = 5
With ActiveForm.Picture2
.Picture = .Image
.PaintPicture ActiveForm.Picture2, 0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth / speed, .ScaleHeight / speed, .ScaleWidth - .ScaleWidth / speed * 2, .ScaleHeight - .ScaleHeight / speed * 2
End With

The problem is that the picture is distorted when I use this method. Can anyone suggest me anothe way to Zoom out and Zoom in a picture?

Thanks.
Kinjal

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

URL: http://www.programmerbase.com/visual-basic/560772/
 
«« Prev - Next »» 3 helpful answers below.
I posted that two times, and no-one did reply. What do you mean with distorted? If you have large difference between height & width of the picture, you should consider modifying my code by setting a general zooming var or modify the scale

kedaman | Tue, 04 Dec 2007 12:33:00 GMT |

Sorry for asking the same question but since VB is new to me I only know the basics of it and nothing in deep. Also i am not at all familiar with API so I couldn't understand your code,and didn't modify it.

However thanks for your reply.

Can you please tell me whwther I can use the same code for demagnifying purpose?

Thanks a lot.

Kinjal.

kinjalgp | Tue, 04 Dec 2007 12:34:00 GMT |

There's nothing API about my code. Just put a negative value instead of a positive value to speed. Also, I suggest you should play around a bit with paintpicture, so that you know what you're doing.

kedaman | Tue, 04 Dec 2007 12:35:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories