Package: cairo

Macro cairo:with-surface

Lambda List

cairo:with-surface ((surface &rest args) &body body)

Syntax

(cairo:with-surface (surface target content width height) body) => result
(cairo:with-surface (surface target format width height) body) => result
(cairo:with-surface (surface target x y width height) body) => result

Arguments

surface -- a cairo:surface-t instance to create and initialize
target -- an existing cairo:surface-t instance used to select the backend of the new surface
content -- a cairo:content-t value for the content for the new surface
format -- a cairo:format-t value for the format of pixels in the surface to create
x -- a number coerced to a double float for the x origin of the subsurface from the top-left of the target surface, in device-space units
y -- a number coerced to a double float for the y origin of the subsurface from the top-left of the target surface, in device-space units
width -- a number coerced to a double float for the width of the subsurface, in device-space units
height -- a number coerced to a double float for the height of the subsurface, in device-space units

Details

The cairo:with-surface macro allocates a new cairo:surface-t instance, initializes the Cairo surface with the given values and executes the body that uses the Cairo surface. After execution of the body the allocated memory for the Cairo surface is released. See the documentation of the cairo:surface-create-similar, cairo:surface-create-similar-image and cairo:surface-create-for-rectangle functions for more information about the initialization of the new Cairo surface.
 

See also

2025-1-18