Method

GdkPixbufPixbufnew_subpixbuf

Declaration [src]

GdkPixbuf*
gdk_pixbuf_new_subpixbuf (
  GdkPixbuf* src_pixbuf,
  int src_x,
  int src_y,
  int width,
  int height
)

Description [src]

Creates a new pixbuf which represents a sub-region of src_pixbuf.

The new pixbuf shares its pixels with the original pixbuf, so writing to one affects both. The new pixbuf holds a reference to src_pixbuf, so src_pixbuf will not be finalized until the new pixbuf is finalized.

Note that if src_pixbuf is read-only, this function will force it to be mutable.

Parameters

src_x

Type: int

X coord in src_pixbuf.

src_y

Type: int

Y coord in src_pixbuf.

width

Type: int

Width of region in src_pixbuf.

height

Type: int

Height of region in src_pixbuf.

Return value

Type: GdkPixbuf

A new pixbuf.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.