Creates a new image surface
The format of pixels in the surface
Width of the surface in pixels
Height of the surface in pixels
Gets the format of the surface
The format of the surface
Gets the height of the surface in pixels
The height of the surface
Gets the width of the surface in pixels
The width of the surface
Writes the contents of the surface to a PNG file
Path to the PNG file to write
StaticcreateCreates a new image surface from a PNG file
Path to a PNG file
A new image surface
Finishes the surface and drops all references to external resources
Performs all pending drawing operations
Returns user data attached to the surface (C API: cairo_surface_get_user_data)
Key used when setting the data
The attached data or null
Gets the device offset of the surface
An array with [x, y] device offset
Gets the device scale of the surface
An array with [x, y] device scale
Attaches user data to the surface (C API: cairo_surface_set_user_data)
Key for the user data
Data to attach
Optionaldestroy: (data: unknown) => voidOptional callback when the surface is destroyed or data is replaced
Sets the device offset of the surface
X offset
Y offset
Sets the device scale of the surface
X scale factor
Y scale factor
A surface that uses in-memory image data buffers