How can i have s fine zoom in/out of a raster image? as i found that the StretchBlt will return a poor output.
Printable View
How can i have s fine zoom in/out of a raster image? as i found that the StretchBlt will return a poor output.
stretchblt is the only easy way i can think of.
if you want you could do it like this. say you zoom in 600%. you could make another picture 3 times as big. then, for every 1 pixel, you have in the original, paint 9 pixels (3*3).
then when your zooming out, you need to take every third pixel in the stretched image and write it to another pixture box.
if you need me to clarify, just tell me
look at www.ur.co.nz you can download code from a tutorial there that does the exact thing you are asking for
http://www.vbforums.com/
Not a gamer but
VB Code:
picdest.PaintPicture picSource.Picture, 0, 0, _ picSource.ScaleWidth * ZoomFactor, picSource.ScaleHeight * ZoomFactor
Is this at all what you are looking for?
haah true that works
Gamers always forget about this since you stop using those functions as soon as you understand bit blt... :)
So this solves the problem?
Thx you guy :)
Oops... I'm coding in eVC for WindowCe platforms. So i can't use any VB code. In eVC, I only manage to find out the SetViewportOrgEx and SetViewportExtEx but not the others two SetWindowExtEx and SetWindowOrgEx. That why i lost the ScaleWidth and ScaleHeight capability in eVC.
As for the link, I will check ut out later.
regards,
Quote:
Originally posted by James Stanich
Not a gamer but
VB Code:
picdest.PaintPicture picSource.Picture, 0, 0, _ picSource.ScaleWidth * ZoomFactor, picSource.ScaleHeight * ZoomFactor
Is this at all what you are looking for?
picdest, picsource, and zoomfactor. Can I use these in VB.NET and what imports should I use?
I'm not very familiar with stretch blt, so if that is the way can you give me some detail~
edit: How would I go about having a click event zoom? (left click zoom in, right click zoom out)
picdest & picsource are just pictureBoxes ;). Zoomfactor looks like its just a variable ;).Quote:
Posted by DavidProgrammer
picdest, picsource, and zoomfactor. Can I use these in VB.NET and what imports should I use?
I'm not very familiar with stretch blt, so if that is the way can you give me some detail~
edit: How would I go about having a click event zoom? (left click zoom in, right click zoom out)
BTW you do know this thread is 2years old? :D
lol. do now~
You think you can help me though? I need a click effect zoom on a picture...like a map
Yea I'm not totally sure what you mean your after though?
It may be solved with that, but I want to learn code. I got scrolling to work with me. Now I need the zoom capability. I don't think BitBLT works really good with VB.NET or it takes more complicated coding than what I know. Is there a way to use the System.Drawing reference to zoom?