Screen Capture Interface

I would like to build a screen capture interface that will allow the user to select an area of the screen.  I already have the code I need to get the selected area as a bitmap.  I am only asking about how to do an interface for selecting an area of the screen.

My first attempt was to create an always on top form, that had the middle portion transparent.  The user could move the form, and resize it.  The transparent portions of the form showed the part that was to be captured.  This worked, until I minimized the other forms in my program.  This form was also minimized.

I would like the capture interface to be available, even if the main form of the application is minimized.  I would also like to capture interface to appear on top of anything else that may be on the screen.

I would like the interface to be "live", so that the user can capture things on the screen, as they are changing.  capturing a static image of the whole screen, and then selecting a portion of that, is not a viable solution.

I have seen other capture programs that allow you to use the mouse to draw a box on the screen, on top of all windows, by selecting two corners.  Any ideas how this is done? or, do you have any other ideas that may work?
LVL 2
wolsenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ivanov_GCommented:
>> "This form was also minimized"
Take a look at my answer here
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21186961.html

Otherwise, you can use CopyRect method of the Canvas to copy spcific area of the desktop.
0
Slick812Commented:
hello  wolsen, , If you want a "Real Time" desktop display and smaller screen Rectangle capture, then I would use a DLL mouse hook and have the user draw his screen rectangle with his mouse, but this is not a delphi form sort of thing and may not be simple, , you can see some code for this at this EE question -


http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20628408.html

ask questions if you need more information
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TiborKiCommented:
Simple:

procedure GetScreen(var bmp: TBitmap);
var
   dc : integer;
   c  : TCanvas;
   R  : TRect;
begin
   bmp := TBitmap.Create;

   dc := GetWindowDC(Form1.Handle);
   try
      c := TCanvas.Create;
      c.Handle := dc;
      R := Rect(0, 0, Screen.Width, Screen.Height);
      bmp.Width := R.Right;
      bmp.Height := R.Bottom;
      bmp.Canvas.CopyRect(R, c, R);
      c.Handle := 0;
      c.Free;
   finally
      ReleaseDC(Form1.Handle, dc);
   end;


end;

In BMP variable you have image of form1!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.