Function gdk4::pixbuf_get_from_surface

source ·
pub fn pixbuf_get_from_surface(
    surface: &Surface,
    src_x: i32,
    src_y: i32,
    width: i32,
    height: i32
) -> Option<Pixbuf>
👎Deprecated: Since 4.12
Expand description

Transfers image data from a cairo::Surface and converts it to a gdk_pixbuf::Pixbuf.

This allows you to efficiently read individual pixels from cairo surfaces.

This function will create an RGB pixbuf with 8 bits per channel. The pixbuf will contain an alpha channel if the @surface contains one.

§Deprecated since 4.12

Use Texture and subclasses instead cairo surfaces and pixbufs


surface to copy from


Source X coordinate within @surface


Source Y coordinate within @surface


Width in pixels of region to get


Height in pixels of region to get


A newly-created pixbuf with a reference count of 1