I don't think there is a built in method. The best and simple way is bilinear interpulation. You can find code for this in c# and for other interpulations too in:
you can move is by ajusting the line that calls bitmap.setpixel so the the image is placed at x+dx,y+dy rather than x,y (where dx and dy are how far you want to shift the thing).
note - make sure your bitmap is large enough to fit your shifted picture on (unless you want it to crop where it goes over the edge).
note2 - think about what you're going to do with the blank space left when it was moved - like the clean bit i found under a rug i turned round the other day, i'm going to have to think about.
By pan I mean that the user (after zooming in on the image) should be able to click on the image and view the parts of the image that are outside of the picturebox's viewing area by moving around the mouse.
interestingly enough i programmed what you're doing just the other day, but i didn't use a picture box. i used a panel, then added the image in the paint event using PaintEventArgs.Graphics.DrawImage - which allows any size picture to be placed anywhere.
...zoom and pan
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.