Thema: Delphi Desktop Screenshot

Einzelnen Beitrag anzeigen

Knotti2015
(Gast)

n/a Beiträge
 
#6

Re: Desktop Screenshot

  Alt 6. Apr 2005, 18:28
mit diesem code

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var DCDesk: HDC; // hDC of Desktop
  bmp: TBitmap;
begin
  {Create a bitmap}
  bmp := TBitmap.Create;
   
  {Set a bitmap sizes}
  bmp.Height := Screen.Height;
  bmp.Width := Screen.Width;

  {Get a desktop DC handle - handle of a display device context}
  DCDesk := GetWindowDC(GetDesktopWindow);
  
  {Copy to any canvas, here canvas of an image}
  BitBlt(bmp.Canvas.Handle, 0, 0, Screen.Width, Screen.Height,
         DCDesk, 0, 0, SRCCOPY);

  {Save the bitmap}
  bmp.SaveToFile('ScreenShot.bmp');

  {Release desktop DC handle}
  ReleaseDC(GetDesktopWindow, DCDesk);

  {Release a bitmap}
  bmp.Free;
end;
kann ich einen Desktop Screenshot machen aber wie konvertiere ich ihn nach jpeg
  Mit Zitat antworten Zitat