since: 2.4

Declaration [src]

gdk_cursor_new_from_pixbuf (
  GdkDisplay* display,
  GdkPixbuf* pixbuf,
  gint x,
  gint y

Description [src]

Creates a new cursor from a pixbuf.

Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions gdk_display_supports_cursor_alpha() and gdk_display_supports_cursor_color() can be used to determine whether RGBA cursors are supported; gdk_display_get_default_cursor_size() and gdk_display_get_maximal_cursor_size() give information about cursor sizes.

If x or y are -1, the pixbuf must have options named “x_hot” and “y_hot”, resp., containing integer values between 0 and the width resp. height of the pixbuf. (Since: 3.0)

On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.

Available since: 2.4



Type: GdkDisplay

The GdkDisplay for which the cursor will be created.

The data is owned by the caller of the function.

Type: GdkPixbuf

The GdkPixbuf containing the cursor image.

The data is owned by the caller of the function.

Type: gint

The horizontal offset of the “hotspot” of the cursor.


Type: gint

The vertical offset of the “hotspot” of the cursor.

Return value

Type: GdkCursor

A new GdkCursor.

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