I’m using a Gtk.WidgetPaintable to take screenshots of some widgets for documentation purposes. It works perfectly when I snapshot the paintable at the same size as the widget:
However, when I snapshot it at a bigger size (applying a scale factor to the dimensions passed to Gtk.WidgetPaintable.snapshot()), the text is clear but the image (although it is an SVG) is upscaled:
Is there a way to have the GtkImage rendered at the given size?
I’m using this in a headless Weston compositor, I tried to set its scale setting to the same value but it did not seem to change anything.
After further testing, the headless backend of Weston doesn’t honor the scale setting, running it nested with the Wayland backend, it works as expected:
[EDIT: Weston 9.0.0 headless backend can be scaled.)
Still, it would be great if snapshooting the paintable at a bigger size renders a crisp image.
I’m currently trying to do very similar things in C (taking screenshots of GtkWidgets headless). Is your project public and can you point to some real code? I’m mostly interested how to do it headless.