Link to home
Start Free TrialLog in
Avatar of Heapster
Heapster

asked on

capturing the whole screen

How do i capture the whole screen as a bitmap. i.e. what the equivalent of doing a print screen is to the clipboard, i want to do to a bitmap.  I've no experience outside of the client area. Thanks, Paul.
Avatar of Heapster
Heapster

ASKER

Adjusted points to 200
Found this on uddf.

Capturing the DESKTOP to a form.canvas

From: Craig Francisco <Craig.Francisco@adm.monash.edu.au>

Try this:
-----------------------------------------------------------------

procedure TScrnFrm.GrabScreen;
 var

    DeskTopDC: HDc;
    DeskTopCanvas: TCanvas;
    DeskTopRect: TRect;
   
 begin
    DeskTopDC := GetWindowDC(GetDeskTopWindow);
    DeskTopCanvas := TCanvas.Create;
    DeskTopCanvas.Handle := DeskTopDC;

    DeskTopRect := Rect(0,0,Screen.Width,Screen.Height);

    ScrnForm.Canvas.CopyRect(DeskTopRect,DeskTopCanvas,DeskTopRect);

    ReleaseDC(GetDeskTopWindow,DeskTopDC);
end;

-----------------------------------------------------------------Note: I haven't tested this, so you may have to massage it a little. You may also have to play around with co-ordinates, depending on what you want to do. Also, if your form is already loaded and displayed, that is what you you will get, so you may want to do a hide and a show...

Have fun,
ZifNab;
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Cheers, havent tested it yet, but looks the job. Nice One.Heap-I.