Click here to Skip to main content
12,949,700 members (72,859 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 20:42pm
Updated 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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,489
CHill60 3,380
Maciej Los 2,913
Jochen Arndt 1,935
ppolymorphe 1,820


Advertise | Privacy | Mobile
Web02 | 2.8.170524.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