Description
The most basic way to create a pixbuf is to wrap an existing
ArtPixBuf structure with a GdkPixbuf to add reference counting
capabilities to it. The gdk_pixbuf_new_from_art_pixbuf() performs
this operation.
As a convenience, you can use the gdk_pixbuf_new_from_data()
function to wrap an existing data buffer with a GdkPixbuf. You
need to specify the destroy notification function that will be
called when the data buffer needs to be freed; this will happen
when the pixbuf's reference count drops to zero and thus the
ArtPixBuf needs to be destroyed. If you have a chunk of static
data compiled into your application, you can pass in NULL as the
destroy notification function so that the data will not be freed.
The gdk_pixbuf_new() function can be used as a convenience to
create a pixbuf with an empty buffer. This is equivalent to
allocating a data buffer using malloc() and then wrapping it with
gdk_pixbuf_new_from_data(). The gdk_pixbuf_new() function will
compute an optimal rowstride so that rendering can be performed
with an efficient algorithm.
As a special case, you can use the gdk_pixbuf_new_from_xpm_data()
function to create a pixbuf from inline XPM image data.
Details
gdk_pixbuf_new_from_art_pixbuf ()
GdkPixbuf* gdk_pixbuf_new_from_art_pixbuf (ArtPixBuf *art_pixbuf); |
Creates a GdkPixbuf by wrapping a libart pixbuf.
gdk_pixbuf_new ()
GdkPixbuf* gdk_pixbuf_new (ArtPixFormat format,
gboolean has_alpha,
int bits_per_sample,
int width,
int height); |
Creates a new GdkPixbuf structure and allocates a buffer for it. The buffer
has an optimal rowstride. Note that the buffer is not cleared; you will have
to fill it completely.
gdk_pixbuf_new_from_data ()
GdkPixbuf* gdk_pixbuf_new_from_data (guchar *data,
ArtPixFormat format,
gboolean has_alpha,
int width,
int height,
int rowstride,
ArtDestroyNotify dfunc,
gpointer dfunc_data); |
Creates a new GdkPixbuf out of in-memory RGB data.
gdk_pixbuf_new_from_xpm_data ()
GdkPixbuf* gdk_pixbuf_new_from_xpm_data (const char **data); |
Creates a new pixbuf by parsing XPM data in memory. This data is commonly
the result of including an XPM file into a program's C source.