views:

181

answers:

2

I want to get a part of picture in a PictureBox by allowing the user to select a rectangular region (similar to how it can be done in Photoshop with selection tool).

How I can do this?

+1  A: 

You would have to draw a rectangle or lines based on where they clicked and dragged. Your starting point would be the mouse x, y and then you would get the last point from mouse release x, y.

Icono123
Here's a link about it: http://forums.devx.com/showthread.php?t=160827.
Icono123
Thanks, @Icono123. This is exactly what I need.
sashaeve
A: 

Catch the mouse events on the Picture Box to define your selection rectangle and use Graphics.DrawRectangle to draw your selection rectangle in the Paint Event of the Picture Box.

Jacob G