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 malloc() and then wrapping it with
24 gdk_pixbuf_new_from_data(). The gdk_pixbuf_new() function will
25 compute an optimal rowstride so that rendering can be performed
26 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 gdk_pixbuf_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 <!-- ##### FUNCTION gdk_pixbuf_new ##### -->
59 <!-- ##### FUNCTION gdk_pixbuf_new_from_data ##### -->
76 <!-- ##### FUNCTION gdk_pixbuf_new_from_xpm_data ##### -->
85 <!-- ##### FUNCTION gdk_pixbuf_copy ##### -->
96 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")