AeroShot (PB-Edition)

Share your advanced PureBasic knowledge/code with the community.
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: AeroShot (PB-Edition)

Post by Denis »

Hi chi,

nice tools :P
It works correctly under Win11 x64

II have captured console windows from Visual Studio 2022 without any problem.
A+
Denis
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: AeroShot (PB-Edition)

Post by chi »

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 ;)
Denis wrote: Sun Nov 20, 2022 7:56 am Hi chi,

nice tools :P
It works correctly under Win11 x64

II have captured console windows from Visual Studio 2022 without any problem.
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.
Et cetera is my worst enemy
BarryG
Addict
Addict
Posts: 4174
Joined: Thu Apr 18, 2019 8:17 am

Re: AeroShot (PB-Edition)

Post by BarryG »

It steals the keyboard focus when taking background shots, which isn't good. But I understand that it's a technical limitation.
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: AeroShot (PB-Edition)

Post by Denis »

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):
Image
A+
Denis
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: AeroShot (PB-Edition)

Post by chi »

Denis wrote: Sun Nov 20, 2022 10:15 am
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):
Image
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) :)
Et cetera is my worst enemy
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: AeroShot (PB-Edition)

Post by Denis »

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.
A+
Denis
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: AeroShot (PB-Edition)

Post by chi »

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: Image
If both "Clipboard" and "File" captures are completely black in the background, then something is going wrong under Win11...
Et cetera is my worst enemy
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: AeroShot (PB-Edition)

Post by Denis »

chi,

with a png file its Ok.

May be function PB SetClipboardImage() isn't correct with AlphaBlended image.
If you get time, you can try with API and give us result.
A+
Denis
Post Reply