How can I capture the screen image in gtkmm4?

Hi, I have a transparent widget in gtkmm4.
I want to create a screen capture which will include the transparent window and what’s underneath it.
I noticed Gtkmm 4 has a new Snapshot class, how can I use it to capture the screen underneath the main gtk window?

You cannot simply capture anything outside your application.

There’s a screenshot portal that allows you to request a screenshot from the compositor (or screencasts for continuous captures).

Just for reference: the “Snapshot” class is used to draw the contents of the widget; it has nothing to do with screenshots.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.