Cairo::ImageSurface#

📦 std

Functions#

Other Functions#

create#

Creates an in-memory image surface of $width by $height pixels and returns it as a Cairo::ImageSurface.

create_for_data#

Creates an image surface that draws directly into a scalar you already hold, rather than into memory of its own.

get_data#

Returns the surface’s pixels as a string of height * stride bytes, or undef if the surface has no accessible pixel data.

get_format#

Returns the surface’s pixel format as a name such as 'argb32' or 'rgb24'.

create_from_png#

Reads a PNG file and returns its contents as a Cairo::ImageSurface.

create_from_png_stream#

Reads a PNG by asking a callback of yours for successive chunks of it, and returns the result as a Cairo::ImageSurface.