Package: gdk

Accessor gdk:surface-scale-factor

Lambda List

gdk:surface-scale-factor (object)

Syntax

(gdk:surface-scale-factor object) => factor

Arguments

object -- a gdk:surface object
factor -- an integer for the scale factor

Details

The accessor for the scale-factor slot of the gdk:surface class returns the internal scale factor that maps from surface coordinates to the actual device pixels. On traditional systems this is 1, but on very high density outputs this can be a higher value (often 2).

A higher value means that drawing is automatically scaled up to a higher resolution, so any code doing drawing will automatically look nicer. However, if you are supplying pixel-based data the scale value can be used to determine whether to use a pixel resource with higher resolution data.

The scale of a surface may change during runtime.
 

See also

2025-08-02