Selecting area rectangle on desktop

.net, c#, graphics, screenshot

Solution

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.

Problem

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.

Original source

Related problems