Thema: Delphi screen capture

Einzelnen Beitrag anzeigen

Benutzerbild von LoCrux
LoCrux

Registriert seit: 5. Mär 2007
Ort: Gwang-Yang-City
48 Beiträge
 
Delphi 2009 Enterprise
 
#2

Re: screen capture

  Alt 1. Dez 2007, 04:14
@mohfa

Zitat von mohfa:
What should i have as Components and other stuffs.
I dont't know what exactly you need. But look here.

For a screenshot I can provide you this:

Delphi-Quellcode:
procedure GetScreenShot (var ABitmap : TBitmap);
var
  DC : THandle;
begin
  if Assigned(ABitmap) then // Check Bitmap<>NIL
  begin
    DC := GetDC(); // Get Desktop DC
    try
      ABitmap.Width := Screen.Width; // Adjust Bitmapsize..
      ABitmap.Height := Screen.Height; // ..to screen size
      BitBlt(ABitmap.Canvas.Handle, // Copy
             0,0,Screen.Width,Screen.Height, // Desktop
             DC, // into
             0,0, // the
             SrcCopy // Bitmap
        );
    finally
      ReleaseDC(0, DC); // Relase DC
    end;
  end;
end;
//EDIT: R-Fehler entfernt
“C++ is an insult to the human brain.” [Niklaus Wirth]

2B OR NOT 2B (.. THAT IS FF)
  Mit Zitat antworten Zitat