Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Suppose I have a picture in picture box and then I would like to select an area of the image. That area should be covered by dotted rectangle.
 
Now I would like to crop this selected image on a button click.
 
Please send me code to do this.
Posted 25-Jan-13 20:42pm
Edited 25-Jan-13 21:32pm
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You need to handle
picture box's event of mousedown, mousemove, mouseup
which capture the action of mouse click and dragging.
C# PictureBox MouseDown MouseUp[^]
 
about drawing a rectangle.
C# Draw Rectangle[^]
 
About crop and resize image:
Simple Image Editor with Crop and Resize while Maintaining Aspect Ratio[^]
An Easy to Use Image Resizing and Cropping Control[^]
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.140709.1 | Last Updated 26 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid