Groups | Blog | Home
all groups > vb.net > february 2004 >

vb.net : Fast drag zoom control


Carl Gilbert
2/7/2004 11:45:16 PM
Hi
I was looking for a component that will enable me to zoom into an image very
easily and quickly. I was hoping there may be something, perhaps part of
VB.NET, that will allow me to drag a box over a selected area and this would
then be displayed at full screen.

Any help on this would be greatly appreciated.
Kind regards, Carl Gilbert

SStory
2/8/2004 1:12:04 AM
Seems like that would just be a matter of stretching the bitmap using GDI+

and then moving the image within the picturebox control so that it showed
the part you were interested in.

Have you tried that?

Should not be too hard I wouldn't think.

Am I missing something?

Shane


[quoted text, click to view]

mr_carl_gilbert NO[at]SPAM hotmail.com
2/8/2004 5:09:38 AM
Ok, that sounds like it could be fairly simple.

I have never used GDI+ before so do you know where I can find either
some sample code or any tutorials/books that may help?

Ken Tucker [MVP]
2/8/2004 10:28:41 AM
Hi,

http://www.bobpowell.net/faqmain.htm
http://www.vb-helper.com/index_vbnet.html#graphics

Ken
----------------------
[quoted text, click to view]

SStory
2/9/2004 4:17:42 PM
Well if you ever used GDI, then there are I guess some similarities in what
is available, but not quite as difficult to use.

Most things based around the graphics object

You always get one in the _paint event

so like
e.graphics.DrawString for example.

There is a Bitmap class that you can stretch an image with.
It has many constructors and seems one of them allows you to pass in an
image(I am not currently working in the IDE)

There is another function that can be used to stretch. I think it was
DrawImage or something similar.
The idea is to draw in memory giving a source and destination and changing
height x width on the destination so that it will be stretched.

I guess with enough math you would have the rubber banding rectangle with
the mouse, they let go, you take the whole image, stretch it, put back in
and calulate where to scroll to so that the right part shows.

There may be an easier way...if anyone knows of one... please post it. I am
fairly new to GDI+ also.

HTH some,

Shane

ps... Ken's links provide a lot of good info.

[quoted text, click to view]

AddThis Social Bookmark Button