Function

Gdk-3.0Gdkpixbuf_get_from_surface

  • Transfers image data from a cairo.Surface and converts it to an RGB(A) representation inside a GdkPixbuf.Pixbuf. This allows you to efficiently read individual pixels from cairo surfaces. For GdkWindows, use gdk_pixbuf_get_from_window() instead.

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

    Parameters

    • surface: default.Surface

      surface to copy from

    • src_x: number

      Source X coordinate within surface

    • src_y: number

      Source Y coordinate within surface

    • width: number

      Width in pixels of region to get

    • height: number

      Height in pixels of region to get

    Returns GdkPixbuf.Pixbuf

    A newly-created pixbuf with a reference count of 1, or null on error