1
<!-- ##### SECTION Title ##### -->
4
<!-- ##### SECTION Short_Description ##### -->
5
Creating a pixbuf from image data that is already in memory.
7
<!-- ##### SECTION Long_Description ##### -->
9
The most basic way to create a pixbuf is to wrap an existing pixel
10
buffer with a #GdkPixbuf structure. You can use the
11
gdk_pixbuf_new_from_data() function to do this You need to specify
12
the destroy notification function that will be called when the
13
data buffer needs to be freed; this will happen when a #GdkPixbuf
14
is finalized by the reference counting functions If you have a
15
chunk of static data compiled into your application, you can pass
16
in %NULL as the destroy notification function so that the data
21
The gdk_pixbuf_new() function can be used as a convenience to
22
create a pixbuf with an empty buffer. This is equivalent to
23
allocating a data buffer using <function>malloc()</function> and
24
then wrapping it with gdk_pixbuf_new_from_data(). The gdk_pixbuf_new()
25
function will compute an optimal rowstride so that rendering can be
26
performed with an efficient algorithm.
30
As a special case, you can use the gdk_pixbuf_new_from_xpm_data()
31
function to create a pixbuf from inline XPM image data.
35
You can also copy an existing pixbuf with the gdk_pixbuf_copy()
36
function. This is not the same as just doing a g_object_ref()
37
on the old pixbuf; the copy function will actually duplicate the
38
pixel data in memory and create a new #GdkPixbuf structure for it.
41
<!-- ##### SECTION See_Also ##### -->
43
gdk_pixbuf_finalize().
46
<!-- ##### SECTION Stability_Level ##### -->
49
<!-- ##### SECTION Image ##### -->
52
<!-- ##### FUNCTION gdk_pixbuf_new ##### -->
65
<!-- ##### FUNCTION gdk_pixbuf_new_from_data ##### -->
82
<!-- ##### FUNCTION gdk_pixbuf_new_from_xpm_data ##### -->
91
<!-- ##### FUNCTION gdk_pixbuf_new_from_inline ##### -->
103
<!-- ##### FUNCTION gdk_pixbuf_new_subpixbuf ##### -->
116
<!-- ##### FUNCTION gdk_pixbuf_copy ##### -->
125
sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")