Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting area rectangle on desktop [closed]

I'm trying to create an application in C#.NET that mimics the ability of the Windows 7 snipping tool, where when the application is run (or by a particular keystroke or however I choose to initiate it), the user can draw a rectangle on the screen no matter which window has focus, in order to capture a rectangular snapshot of the desktop.

I already know how to utilize the Graphics.CopyFromScreen() method in order to save a snapshot given a particular rectangle, but where I'm stumped is the actual rectangular selection and how to obtain the bounds from that.

like image 546
William Thomas Avatar asked May 08 '12 18:05

William Thomas


1 Answers

The TeboScreen: Basic C# Screen Capture Application on Code Project does exactly this.

Holding down the left mouse button, the user draws a rectangle specifying which part of the screen they wish to capture. ... The mouse_Move event is used to decide on whether the user is drawing, dragging(moving) or resizing the selection area.

like image 180
Joshua Drake Avatar answered Sep 20 '22 21:09

Joshua Drake