Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#5

Re: Screenshot of semitransparent window

  Alt 27. Nov 2013, 17:37
Yes, I know how to make normal screenshot:

Delphi-Quellcode:
begin
  hDesktop := GetDesktopWindow;
  hScreenDC := GetWindowDC(hDesktop);
  hMemDC := CreateCompatibleDC(hScreenDC);
  hbm := CreateCompatibleBitmap(hScreenDC, AWidth, AHeight);
  try
    SelectObject(hMemDC, hbm);
    BitBlt(hMemDC, 0, 0, AWidth, AHeight, hScreenDC, ALeft, ATop, R[AReversed]);

    AOutput.Width := AWidth;
    AOutput.Height := AHeight;
    if AOutput.Canvas.TryLock then
    begin
      try
        AOutput.PixelFormat := pf24bit;
        BitBlt(AOutput.Canvas.Handle, 0, 0, AWidth, AHeight, hMemDC, 0, 0, SRCCOPY);
      finally
        AOutput.Canvas.Unlock;
      end;
    end;
  finally
    ReleaseDC(hDesktop, hScreenDC);
    DeleteDC(hMemDC);
    DeleteObject(hbm);
  end;
end;
Is required more than pf32bit or TBitmap32. F1
  Mit Zitat antworten Zitat