Method cairo_image_surface_create_for_data
cairo_image_surface_create_for_data(nint, int, int, int, int)
Creates an image surface that uses the provided pixel buffer as its backing store.
public static extern nint cairo_image_surface_create_for_data(nint data, int format, int width, int height, int stride)
Parameters
datanintPointer to the pixel buffer (byte*). The buffer must remain valid for the lifetime of the surface.
formatintCairo pixel format (e.g., CAIROFORMATARGB32).
widthintWidth of the surface in pixels.
heightintHeight of the surface in pixels.
strideintNumber of bytes between the start of rows in the buffer.
Returns
- nint
A pointer to a newly created
cairo_surface_t. ReturnsIntPtr.Zeroon failure. The caller is responsible for calling cairo_surface_destroy(nint) when finished.