Einzelnen Beitrag anzeigen

FaFu
(Gast)

n/a Beiträge
 
#4

Re: Pixel aus aktivem Fenster lesen...

  Alt 6. Jun 2009, 13:17
Ich hatte davor das
Delphi-Quellcode:
var
  Bmp: TBitmap;
  color1:Tcolor;
  R,G,B: Integer;
begin
  Bmp := TBitmap.Create;

  try

    FormularScreenShot(Bmp, GetDesktopWindow);
    Canvas.Draw(0, 0, Bmp);
und jetzt nach dem anderen Vorschlag das:
Delphi-Quellcode:
var
  hWnd, DC: Cardinal;
  Rect: TRect;
  Bmp :TBitmap;
begin
 try
  hWnd := GetDesktopWindow;
  GetWindowRect( hWnd, Rect );
  DC := GetDC( hWnd );
  Bmp := TBitmap.Create;
  Bmp.Width := Rect.Right-Rect.Left;
  Bmp.Height := Rect.Bottom-Rect.Top;
  BitBlt( Bmp.Canvas.Handle, 0, 0, Bmp.Width, Bmp.Height,
    DC, 0, 0, SRCCOPY );

  Canvas.Draw( 0, 0, Bmp );
 finally
   Bmp.Free;
Welches ist schneller und belastet somit weniger den prozessor?
mfG
  Mit Zitat antworten Zitat