Click here to Skip to main content
13,256,446 members (50,708 online)
Rate this:
Please Sign up or sign in to vote.
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 25-Jan-13 21:42pm
Updated 25-Jan-13 22:32pm
Rate this: bad
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[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100