Package: cairo

Function cairo:set-source-surface

Lambda List

cairo:set-source-surface (cr surface x y)

Arguments

cr -- a cairo:context-t instance
surface -- a cairo:surface-t instance to be used to set the source pattern
x -- a number for the user-space x coordinate of the surface origin
y -- a number for the user-space y coordinate of the surface origin

Details

This is a convenience function for creating a pattern from surface and setting it as the source in cr with the cairo:source function.

The x and y arguments give the user-space coordinate at which the surface origin should appear. The surface origin is its upper-left corner before any transformation has been applied. The x and y arguments are negated and then set as translation values in the pattern matrix.

Other than the initial translation pattern matrix, as described above, all other pattern attributes, such as its extend mode, are set to the default values as in the cairo:pattern-create-for-surface function. The resulting pattern can be queried with the cairo:source function so that these attributes can be modified if desired, for example, to create a repeating pattern with with the cairo:pattern-extend function.

Notes

The numbers for the arguments are coerced to double floats before being passed to the foreign C function.
 

See also

2025-1-2