BarryG wrote: Sun Nov 20, 2022 7:15 am
Nice code, but it forces the target window to the foreground. Is there a way to do it without that and keep the Aero theme? Having big windows stealing the focus is not good.
Hi BarryG, I'm afraid that's not possible with the current implementation. What exactly is the problem with forcing the window in the foreground? After all it's only for a screenshot
Thanks for testing, Denis! Don't forget that you' ll probably need to set a larger margin on Win11 to capture the entire shadow plane of the window.
I set margin to 1.
Trying with default margin, the shadow looks like that (completely black, no shadow):
It seems that SetClipboardImage doesn't work with 32bit images anymore (on Win11)... Use: Capture to File with 80px margin
BarryG wrote: Sun Nov 20, 2022 8:59 am
It steals the keyboard focus when taking background shots, which isn't good. But I understand that it's a technical limitation.
Yup, it's a limitation... Unless you're somehow able to take two screenshots, one with a black and one with a white background, from a (partially) hidden Window with overflow (margin)
Denis wrote: Sun Nov 20, 2022 1:23 pm
With a bigger margin, it's the same.
with a black or white background, it's the same.
Displaying partially on a black and on a white background, it's the same.
The part with the black/white background wasn't meant for you . This is how the program works in general. You take a 32bit screenshot of the window + margin with a white and a black background and calculate the alpha channel.
Like I said, capturing to the clipboard on Win11 seems broken, but capturing to a png file with 80px margin should give you something like this:
If both "Clipboard" and "File" captures are completely black in the background, then something is going wrong under Win11...