Screen Capture Interface

Posted on 2004-11-17
Medium Priority
Last Modified: 2010-05-18
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?
Question by:wolsen
LVL 12

Expert Comment

ID: 12612226
>> "This form was also minimized"
Take a look at my answer here

Otherwise, you can use CopyRect method of the Canvas to copy spcific area of the desktop.
LVL 34

Accepted Solution

Slick812 earned 1540 total points
ID: 12621898
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 -


ask questions if you need more information

Expert Comment

ID: 13026464

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

   dc := GetWindowDC(Form1.Handle);
      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;
      ReleaseDC(Form1.Handle, dc);


In BMP variable you have image of form1!

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question