![]() |
Delphi-Version: 2010
Screenshot of semitransparent window
I have window with 32-bit PNG as background, so window is (semi)transparent in some areas. How to make screenshot of this window without desktop underneath it (like taskbar thumbnails in 7, you know)?
|
AW: Screenshot of semitransparent window
During the screenshot underlay the window with some monochrome panel. Check
![]() Sherlock |
Re: AW: Screenshot of semitransparent window
Zitat:
|
AW: Screenshot of semitransparent window
Well, if it is your window and you want to use this function more often, my first approach would be to create a second window in the same application with the same exact measurements and xy coordinates only the z being lower (or is it higher :gruebel:). This new form should of course not be transparent, and have some uniform color (gray for best results). Show this form only during screenshot event...and presto!
If it is not your window and application however, things can get a wee bit more tricky. You would have to find out all the necessary size and position data yourself and create the backdrop window according to the gathered information. I guess ![]() ![]() Sherlock |
Re: Screenshot of semitransparent window
Yes, I know how to make normal screenshot:
Delphi-Quellcode:
Is required more than pf32bit or TBitmap32. F1 :(
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; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:06 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz