summaryrefslogtreecommitdiff
path: root/docs/reference/gdk/tmpl/pixmaps.sgml
blob: 52122394f8713d40d8d6a94cdfde20fe400076bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!-- ##### SECTION Title ##### -->
Bitmaps and Pixmaps

<!-- ##### SECTION Short_Description ##### -->
Offscreen drawables

<!-- ##### SECTION Long_Description ##### -->
<para>
Pixmaps are offscreen drawables. They can be drawn upon with the
standard drawing primitives, then copied to another drawable (such as
a #GdkWindow) with gdk_pixmap_draw(). The depth of a pixmap
is the number of bits per pixels. Bitmaps are simply pixmaps
with a depth of 1. (That is, they are monochrome bitmaps - each
pixel can be either on or off).
</para>
<para>
GTK 3 will remove #GdkPixmap and #GdkBitmap. You should use cairo
surfaces instead. However, because a lot of functions still use these
types, they are not deprecated.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### SECTION Image ##### -->


<!-- ##### TYPEDEF GdkPixmap ##### -->
<para>
An opaque structure representing an offscreen drawable.
Pointers to structures of type #GdkPixmap, #GdkBitmap,
and #GdkWindow, can often be used interchangeably. 
The type #GdkDrawable refers generically to any of
these types.
</para>


<!-- ##### FUNCTION gdk_pixmap_new ##### -->
<para>
Create a new pixmap with a given size and depth.
</para>
<para>
Please use gdk_window_create_similar_surface() instead of this
function if you're not forced to use a #GdkPixmap. It is intended
as the replacement function for this function in GTK 3.
</para>

@drawable: A #GdkDrawable, used to determine default values
for the new pixmap. Can be %NULL if @depth is specified,
@width: The width of the new pixmap in pixels.
@height: The height of the new pixmap in pixels.
@depth: The depth (number of bits per pixel) of the new pixmap. 
  If -1, and @drawable is not %NULL, the depth of the new
  pixmap will be equal to that of @drawable.
@Returns: the #GdkPixmap


<!-- ##### FUNCTION gdk_bitmap_create_from_data ##### -->
<para>
Creates a new bitmap from data in XBM format.
</para>

@drawable: a #GdkDrawable, used to determine default values
for the new pixmap. Can be %NULL, in which case the root
window is used.
@data: a pointer to the XBM data.
@width: the width of the new pixmap in pixels.
@height: the height of the new pixmap in pixels.
@Returns: the #GdkBitmap
@Deprecated: 2.22: You can create a Cairo image surface using
cairo_image_surface_create_for_data() instead. Specify
%CAIRO_FORMAT_A1 as the format to get a bitmap. Keep in mind that
Cairo images must have a rowstride of 4 bytes, so you will need
to align your data properly. If you must use a pixmap, use
gdk_pixmap_new() with a depth of 1 to create a bitmap and then use
gdk_cairo_create(), cairo_set_source_surface() and cairo_paint()
to draw the image surface to the bitmap.


<!-- ##### FUNCTION gdk_pixmap_create_from_data ##### -->
<para>
Create a two-color pixmap from data in XBM data.
</para>

@drawable: a #GdkDrawable, used to determine default values
for the new pixmap. Can be %NULL, if the depth is given.
@data: a pointer to the data.
@width: the width of the new pixmap in pixels.
@height: the height of the new pixmap in pixels.
@depth: the depth (number of bits per pixel) of the new pixmap.
@fg: the foreground color.
@bg: the background color.
@Returns: the #GdkPixmap
@Deprecated: 2.22: If you must replicate the functionality of this
function, create a pixmap using gdk_pixmap_new(), cairo_paint() it
with the background color and then create a Cairo image surface as
pointed out in the docs to gdk_bitmap_create_from_data() and use
this surface with cairo_mask_surface() to paint the foreground color.


<!-- ##### FUNCTION gdk_pixmap_create_from_xpm ##### -->


@drawable: 
@mask: 
@transparent_color: 
@filename: 
@Returns: 


<!-- ##### FUNCTION gdk_pixmap_colormap_create_from_xpm ##### -->


@drawable: 
@colormap: 
@mask: 
@transparent_color: 
@filename: 
@Returns: 


<!-- ##### FUNCTION gdk_pixmap_create_from_xpm_d ##### -->


@drawable: 
@mask: 
@transparent_color: 
@data: 
@Returns: 


<!-- ##### FUNCTION gdk_pixmap_colormap_create_from_xpm_d ##### -->


@drawable: 
@colormap: 
@mask: 
@transparent_color: 
@data: 
@Returns: 


<!-- ##### FUNCTION gdk_pixmap_get_size ##### -->
<para>

</para>

@pixmap: 
@width: 
@height: 


<!-- ##### MACRO gdk_pixmap_ref ##### -->
<para>
Deprecated equivalent of g_object_ref().
</para>

@Returns: @pixmap


<!-- ##### MACRO gdk_pixmap_unref ##### -->
<para>
Deprecated equivalent of g_object_unref().
</para>



<!-- ##### TYPEDEF GdkBitmap ##### -->
<para>
An opaque structure representing an offscreen drawable of depth
1. Pointers to structures of type #GdkPixmap, #GdkBitmap, and
#GdkWindow, can often be used interchangeably.  The type #GdkDrawable
refers generically to any of these types.
</para>


<!-- ##### MACRO gdk_bitmap_ref ##### -->
<para>
Deprecated equivalent of g_object_ref().
</para>

@Returns: @pixmap


<!-- ##### MACRO gdk_bitmap_unref ##### -->
<para>
Deprecated equivalent of g_object_unref().
</para>