It works when the display is at 1x scale. But with a 2x scale display, the image is rendered blurry and two times as large as expected. How should I fix this?
I find that there is a gtk_scaler_* API, but it is not exposed via GI. There is also a gdk_paintable_new_from_file_scaled API, but it is also not exposed via GI. I have to write in C?
Oh, I think I now understand what you’re asking. You want to render a picture at device pixels, i.e. not scaled 2x along with the rest of the UI. Or, taken the other way around, compared to the UI, you want to render the picture at 0.5x, then it will match the device pixels.
Thanks, set_size_request works! I didn’t think I needed to manually calculate the size and shrink it. In GTK 3 era, rendering a GdkPixbuf onto a canvas like this made the result blurry.