]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk-pixbuf/tmpl/creating.sgml
Your eyes are bloodshot.
[~andy/gtk] / docs / reference / gdk-pixbuf / tmpl / creating.sgml
1 <!-- ##### SECTION Title ##### -->
2 Image Data in Memory
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Creating a pixbuf from image data that is already in memory.
6
7 <!-- ##### SECTION Long_Description ##### -->
8   <para>
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
17     will not be freed.
18   </para>
19
20   <para>
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.
27   </para>
28
29   <para>
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.
32   </para>
33
34   <para>
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.
39   </para>
40
41 <!-- ##### SECTION See_Also ##### -->
42   <para>
43     gdk_pixbuf_finalize().
44   </para>
45
46 <!-- ##### FUNCTION gdk_pixbuf_new ##### -->
47 <para>
48
49 </para>
50
51 @colorspace: 
52 @has_alpha: 
53 @bits_per_sample: 
54 @width: 
55 @height: 
56 @Returns: 
57
58
59 <!-- ##### FUNCTION gdk_pixbuf_new_from_data ##### -->
60 <para>
61
62 </para>
63
64 @data: 
65 @colorspace: 
66 @has_alpha: 
67 @bits_per_sample: 
68 @width: 
69 @height: 
70 @rowstride: 
71 @destroy_fn: 
72 @destroy_fn_data: 
73 @Returns: 
74
75
76 <!-- ##### FUNCTION gdk_pixbuf_new_from_xpm_data ##### -->
77 <para>
78
79 </para>
80
81 @data: 
82 @Returns: 
83
84
85 <!-- ##### FUNCTION gdk_pixbuf_copy ##### -->
86 <para>
87
88 </para>
89
90 @pixbuf: 
91 @Returns: 
92
93 <!--
94 Local variables:
95 mode: sgml
96 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
97 End:
98 -->
99
100