Name
csurface:CreateSimilarImage -- create similar image surface
Synopsis
handle = csurface:CreateSimilarImage(format, width, height)
Function
Create a new image surface that is as compatible as possible for uploading to and the use in conjunction with an existing surface. However, this surface can still be used like any normal image surface. Unlike csurface:CreateSimilar() the new image surface won't inherit the device scale from the source surface. The format parameter must be set to a pixel format constant. See cairo.ImageSurface for details.

Initially the surface contents are all 0 (transparent if contents have transparency, black otherwise.)

Use csurface:CreateSimilar() if you don't need an image surface.

This function returns a handle to the newly allocated image surface. The caller owns the surface and should call csurface:Free() when done with it.

This function always returns a valid handle, but it will return a handle to a "nil" surface if other is already in an error state or any other error occurs.

Inputs
format
the format for the new surface
width
width of the new surface, (in pixels)
height
height of the new surface (in pixels)
Results
handle
handle to a new surface

Show TOC