Skip to content

Add new capture technology#932

Merged
Lakritzator merged 1 commit into
mainfrom
feature/WindowsGraphicsCapture
Feb 8, 2026
Merged

Add new capture technology#932
Lakritzator merged 1 commit into
mainfrom
feature/WindowsGraphicsCapture

Conversation

@Lakritzator

Copy link
Copy Markdown
Member

This PR adds WindowsGraphicsCapture functionality to capture the Window (and screen, but this is not yet included) as a Beta Test feature.

WGC is a relative new feature in Windows, arrived with Windows 10, made to capture Windows and screens with the latest technologies. This should work with HDR, high DPI and also with games, but I didn't put it through extensive tests... Which is why we put it behind a feature toggle.

WGC captures the window contents from the composition engine, sometimes it takes a bit longer if there are no changes, so we need to monitor this. I also noticed that it uses transparency, let's see how that works.

Anyway, to make this work on .NET 10 would be easy, unfortunately we are on .NET framework, so I had to use some tricks and DirectX code, including SharpDx (no longer maintained) as a dependency would not be very satisfactory, so I had to create the needed interop classes myself.

For now I only enabled Window capture, due to limited time. The screen capture will need to be added later, as this is monitor based and not 100% in line with the current GDI (bitblt) capture.

… screen, but this is not yet included) as a Beta Test feature.
@Lakritzator

Copy link
Copy Markdown
Member Author

It's ✨🪄

@Lakritzator Lakritzator merged commit a873f2f into main Feb 8, 2026
2 checks passed
@Lakritzator Lakritzator deleted the feature/WindowsGraphicsCapture branch February 8, 2026 20:41
@Lakritzator

Copy link
Copy Markdown
Member Author

Placed this behind a BetaTester feature toggle, which is currently only available via the greenshot.ini file.

Those wanting to help beta-testing this, just drop a file called greenshot-fixed.ini (if there isn't one already) with the following in the %APPDATA%\Greenshot directory and restart Greenshot:

[Core]
BetaTester=True

@Lakritzator Lakritzator mentioned this pull request Feb 8, 2026
@Christian-Schulz

Copy link
Copy Markdown
Contributor

🤩

@Lakritzator

Copy link
Copy Markdown
Member Author

Can you take her for a ride? Wasn't easy to get her running...

@Christian-Schulz

Copy link
Copy Markdown
Contributor

I played around with it a bit.

  1. the new version has transparent borders.😍
image
  1. Endless loop and/or wrong capture
    I was stuck here:
    while (frameTemp == null)
    {
    frameTemp = framePool.TryGetNextFrame();
    }

    Steps:
  • minimize all windows (used ShowDesktop function)
  • used Greenshort SystemTray menu "capture window from list"
  • pick a random window
  • then nothing happens
  • until i open the same window manually
  • sometimes it captures the window correct
  • sometimes it captures only parts of the window
  • and somtimes i stuck in the loop for ever (i think this was one of the Greenshot editor window from the same debug session)

@Lakritzator

Copy link
Copy Markdown
Member Author

Thanks for having a look!

I also like the transparency, even though it said somewhere that it doesn't do that 😂

The loop somewhat can be explained, Windows waits until something changes. Why nothing changes is a good question.

What do you mean with parts of the Window? More or less, Microsoft advertises this Technology to solve exactly THAT.

@Chaython

Copy link
Copy Markdown

I set

[Core]
BetaTester=True

and greenshot still doesn't seem to handle HDR correctly, preview/screenshot is very blown out still.
Is there something else I need to do?

@Dmi2014

Dmi2014 commented Mar 9, 2026

Copy link
Copy Markdown

just wanted to thank you, man. This thing was so fucking annoying.

@Lakritzator

Lakritzator commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

@Chaython

I set

[Core]
BetaTester=True

and greenshot still doesn't seem to handle HDR correctly, preview/screenshot is very blown out still. Is there something else I need to do?

It's currently only for the window capture, not the whole screen.

@Lakritzator

Copy link
Copy Markdown
Member Author

With V1.4.147 the new tech is also used with the region and screen captures. Still needs the BetaTester as it's not tested enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants