Context.create

Creates a new cairo_t with all graphics state parameters set to default values and with target as a target surface. The target surface should be constructed with a backend-specific function such as cairo_image_surface_create() (or any other cairo_backend_surface_create() variant). This function references target, so you can immediately call cairo_surface_destroy() on it if you don't need to maintain a separate reference to it.

class Context
static
create

Parameters

target Surface

target surface for the context

Return Value

Type: Context

a newly allocated cairo_t with a reference count of 1. The initial reference count should be released with cairo_destroy() when you are done using the cairo_t. This function never returns NULL. If memory cannot be allocated, a special cairo_t object will be returned on which cairo_status() returns CAIRO_STATUS_NO_MEMORY. You can use this object normally, but no drawing will be done.

Meta