I want to be able to create a zoom box with the mouse in order to view portions of a graphic in a picturebox. Any Ideas? Thanks
Printable View
I want to be able to create a zoom box with the mouse in order to view portions of a graphic in a picturebox. Any Ideas? Thanks
See if this sample project works for you.
you can record the up and down mouse clicks to get your square and read each pixel one at a time with pget(vb5 & 6 only)
Then you can have a 2nd picture box and paint the pixels with the line command making a solid square (vb5 & 6 only) of whatever zoom size you wish.
If you use built-in functions such as stretchblt to do this instead of manually, keep in mind that your output can be anti-aliased in the pasting operation.
if you happen to want to do this in directx instead, i have sample code you could look off of, but the setup is more complicated.
StretchBlt is not built-in function - it's one of the Windows GDI32's entries (aka Win32 APIs).Quote:
Originally Posted by Lord Orwell
i didn't say built-in to vb. I meant built-in to windows.
I know you didn't and that's why I replied ...
When you are in specific laguage discussion group expression "built-in" means exactly what's built into language so maybe next time you want to be a bit more specific. ;)
Point well taken. I (possibly erronously) assumed the example code in the other form used api blitting, since they almost always do.
OK i retract my answer. Your sample code does exactly what i suggested. Note: the sample in the other thread does indeed use stretchblt.
Thank you very much. This is exactly what I was looking for.