|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Crop/Zoom Image in Container1. 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! Here is a link to a sample that will get you going. It's written with VB.Net
2002. But, should work. james http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=2D473451-21AA-4A0B-9060-E3D1CA40C74A Show quoteHide quote "DMCD" <D***@discussions.microsoft.com> wrote in message news:57AE9250-4908-4550-B091-2DA7256A1DBA@microsoft.com... >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! > > >
VB.NET - Issues with VB.NET FTP Class to UNIX FTP Server
what's up? reading xml Best Practices - Coding Convention Question How do you know when all databindings on form are complete? Reading Excel in VB.NET SQL Distinct DoEvents in VB.NET Committing Byte Array to Disk Building VB.NET Interface definitions from a COM interface Process BUG? |
|||||||||||||||||||||||