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