]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk-pixbuf/tmpl/creating.sgml
Make 3.0 parallel-installable to 2.x
[~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 <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.
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 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.
39   </para>
40
41 <!-- ##### SECTION See_Also ##### -->
42   <para>
43     gdk_pixbuf_finalize().
44   </para>
45
46 <!-- ##### SECTION Stability_Level ##### -->
47
48
49 <!-- ##### SECTION Image ##### -->
50
51
52 <!-- ##### FUNCTION gdk_pixbuf_new ##### -->
53 <para>
54
55 </para>
56
57 @colorspace: 
58 @has_alpha: 
59 @bits_per_sample: 
60 @width: 
61 @height: 
62 @Returns: 
63
64
65 <!-- ##### FUNCTION gdk_pixbuf_new_from_data ##### -->
66 <para>
67
68 </para>
69
70 @data: 
71 @colorspace: 
72 @has_alpha: 
73 @bits_per_sample: 
74 @width: 
75 @height: 
76 @rowstride: 
77 @destroy_fn: 
78 @destroy_fn_data: 
79 @Returns: 
80
81
82 <!-- ##### FUNCTION gdk_pixbuf_new_from_xpm_data ##### -->
83 <para>
84
85 </para>
86
87 @data: 
88 @Returns: 
89
90
91 <!-- ##### FUNCTION gdk_pixbuf_new_from_inline ##### -->
92 <para>
93
94 </para>
95
96 @data_length: 
97 @data: 
98 @copy_pixels: 
99 @error: 
100 @Returns: 
101
102
103 <!-- ##### FUNCTION gdk_pixbuf_new_subpixbuf ##### -->
104 <para>
105
106 </para>
107
108 @src_pixbuf: 
109 @src_x: 
110 @src_y: 
111 @width: 
112 @height: 
113 @Returns: 
114
115
116 <!-- ##### FUNCTION gdk_pixbuf_copy ##### -->
117 <para>
118
119 </para>
120
121 @pixbuf: 
122 @Returns: <!--
123 Local variables:
124 mode: sgml
125 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
126 End:
127 -->
128
129