Function

Gdk-4.0Gdkpixbuf_get_from_surfaceDeprecated 4.12

  • Transfers image data from a cairo_surface_t and converts it to a GdkPixbuf.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.

    Parameters

    • Deprecatedsurface: default.Surface

      surface to copy from

    • Deprecatedsrc_x: number

      Source X coordinate within surface

    • Deprecatedsrc_y: number

      Source Y coordinate within surface

    • Deprecatedwidth: number

      Width in pixels of region to get

    • Deprecatedheight: number

      Height in pixels of region to get

    Returns GdkPixbuf.Pixbuf

    A newly-created pixbuf with a reference count of 1

    since 4.12: Use Gdk.Texture and subclasses instead cairo surfaces and pixbufs