Click here to Skip to main content
13,596,545 members
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 20:42pm
Updated 25-Jan-13 21:32pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^]

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 | Cookies | Terms of Service
Web03 | 2.8.180621.3 | Last Updated 26 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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