Table of Contents

Method cairo_image_surface_create_for_data

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

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

data nint

Pointer to the pixel buffer (byte*). The buffer must remain valid for the lifetime of the surface.

format int

Cairo pixel format (e.g., CAIROFORMATARGB32).

width int

Width of the surface in pixels.

height int

Height of the surface in pixels.

stride int

Number of bytes between the start of rows in the buffer.

Returns

nint

A pointer to a newly created cairo_surface_t. Returns IntPtr.Zero on failure. The caller is responsible for calling cairo_surface_destroy(nint) when finished.