Crop/Zoom Image in Container

G

Guest

I want to allow my program users to:
1. Open a jpg inside of a panel control
(PictureBox control inside Panel control ... PictureBox picture set to
user's jpg file selection);
2. Zoom in and out on the jpg
(change the picturebox size mode to zoom and scale the photo);
3. Move the jpg up, down, left right within a container control
(using the MouseDown and MouseMove events, I change the location
of the jpg);
4. Save the visible portion, at its zoom level, as a new jpg.
(THIS IS MY PROBLEM)

I understand the DrawImage function and how it may be used to get a portion
of one image and "draw" it elsewhere. My problem is the coordinate system (I
think).

How do I specify the portion of the picture that is visible in the panel
(i.e., the source rectangle). My difficulty is compounded by the fact that
the image has been scaled.

Any help would be appreciated.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top