Click here to Skip to main content
15,886,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 25-Jan-13 21:32pm
v4

 
Share this answer
 
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[^]
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900