]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxBitmap}}\label{wxbitmap} |
2 | ||
3 | %\overview{Overview}{wxbitmapoverview} | |
4 | % | |
5 | This class encapsulates the concept of a platform-dependent bitmap, | |
6 | either monochrome or colour. | |
7 | ||
8 | \wxheading{Derived from} | |
9 | ||
10 | \helpref{wxGDIObject}{wxgdiobject}\\ | |
11 | \helpref{wxObject}{wxobject} | |
12 | ||
954b8ae6 JS |
13 | \wxheading{Include files} |
14 | ||
15 | <wx/bitmap.h> | |
16 | ||
a660d684 KB |
17 | \wxheading{See also} |
18 | ||
06d20283 RD |
19 | \helpref{wxBitmap overview}{wxbitmapoverview}, |
20 | \helpref{supported bitmap file formats}{supportedbitmapformats}, | |
21 | \helpref{wxDC::Blit}{wxdcblit}, | |
22 | \helpref{wxIcon}{wxicon}, \helpref{wxCursor}{wxcursor}, \helpref{wxBitmap}{wxbitmap}, | |
2fd284a4 | 23 | \helpref{wxMemoryDC}{wxmemorydc} |
a660d684 KB |
24 | |
25 | \latexignore{\rtfignore{\wxheading{Members}}} | |
26 | ||
27 | \membersection{wxBitmap::wxBitmap}\label{wxbitmapconstr} | |
28 | ||
29 | \func{}{wxBitmap}{\void} | |
30 | ||
31 | Default constructor. | |
32 | ||
33 | \func{}{wxBitmap}{\param{const wxBitmap\& }{bitmap}} | |
34 | ||
1e6d9499 | 35 | Copy constructor. |
a660d684 | 36 | |
eaaa6a06 | 37 | \func{}{wxBitmap}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} |
a660d684 KB |
38 | |
39 | Creates a bitmap from the given data, which can be of arbitrary type. | |
40 | ||
eaaa6a06 JS |
41 | \func{}{wxBitmap}{\param{const char}{ bits[]}, \param{int}{ width}, \param{int}{ height}\\ |
42 | \param{int}{ depth = 1}} | |
a660d684 KB |
43 | |
44 | Creates a bitmap from an array of bits. | |
45 | ||
eaaa6a06 | 46 | \func{}{wxBitmap}{\param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} |
a660d684 KB |
47 | |
48 | Creates a new bitmap. | |
49 | ||
50 | \func{}{wxBitmap}{\param{const char**}{ bits}} | |
51 | ||
52 | Creates a bitmap from XPM data. | |
53 | ||
eaaa6a06 | 54 | \func{}{wxBitmap}{\param{const wxString\& }{name}, \param{long}{ type}} |
a660d684 KB |
55 | |
56 | Loads a bitmap from a file or resource. | |
57 | ||
58 | \wxheading{Parameters} | |
59 | ||
60 | \docparam{bits}{Specifies an array of pixel values.} | |
61 | ||
62 | \docparam{width}{Specifies the width of the bitmap.} | |
63 | ||
64 | \docparam{height}{Specifies the height of the bitmap.} | |
65 | ||
66 | \docparam{depth}{Specifies the depth of the bitmap. If this is omitted, the display depth of the | |
67 | screen is used.} | |
68 | ||
69 | \docparam{name}{This can refer to a resource name under MS Windows, or a filename under MS Windows and X. | |
1e6d9499 | 70 | Its meaning is determined by the {\it type} parameter.} |
a660d684 KB |
71 | |
72 | \docparam{type}{May be one of the following: | |
73 | ||
74 | \twocolwidtha{5cm} | |
75 | \begin{twocollist} | |
76 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_BMP}}}{Load a Windows bitmap file.} | |
77 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_BMP\_RESOURCE}}}{Load a Windows bitmap from the resource database.} | |
78 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_GIF}}}{Load a GIF bitmap file.} | |
79 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_XBM}}}{Load an X bitmap file.} | |
80 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_XPM}}}{Load an XPM bitmap file.} | |
81 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_RESOURCE}}}{Load a Windows resource name.} | |
82 | \end{twocollist} | |
83 | ||
84 | The validity of these flags depends on the platform and wxWindows configuration. | |
2fd284a4 JS |
85 | If all possible wxWindows settings are used, the Windows platform supports BMP file, BMP resource, |
86 | XPM data, and XPM. Under wxGTK, the available formats are BMP file, XPM data, XPM file, and PNG file. | |
87 | Under wxMotif, the available formats are XBM data, XBM file, XPM data, XPM file.} | |
a660d684 KB |
88 | |
89 | \wxheading{Remarks} | |
90 | ||
91 | The first form constructs a bitmap object with no data; an assignment or another member function such as Create | |
92 | or LoadFile must be called subsequently. | |
93 | ||
94 | The second and third forms provide copy constructors. Note that these do not copy the | |
95 | bitmap data, but instead a pointer to the data, keeping a reference count. They are therefore | |
96 | very efficient operations. | |
97 | ||
98 | The fourth form constructs a bitmap from data whose type and value depends on | |
99 | the value of the {\it type} argument. | |
100 | ||
101 | The fifth form constructs a (usually monochrome) bitmap from an array of pixel values, under both | |
102 | X and Windows. | |
103 | ||
104 | The sixth form constructs a new bitmap. | |
105 | ||
106 | The seventh form constructs a bitmap from pixmap (XPM) data, if wxWindows has been configured | |
107 | to incorporate this feature. | |
108 | ||
109 | To use this constructor, you must first include an XPM file. For | |
110 | example, assuming that the file {\tt mybitmap.xpm} contains an XPM array | |
111 | of character pointers called mybitmap: | |
112 | ||
113 | \begin{verbatim} | |
114 | #include "mybitmap.xpm" | |
115 | ||
116 | ... | |
117 | ||
118 | wxBitmap *bitmap = new wxBitmap(mybitmap); | |
119 | \end{verbatim} | |
120 | ||
121 | The eighth form constructs a bitmap from a file or resource. {\it name} can refer | |
122 | to a resource name under MS Windows, or a filename under MS Windows and X. | |
123 | ||
124 | Under Windows, {\it type} defaults to wxBITMAP\_TYPE\_BMP\_RESOURCE. | |
2fd284a4 | 125 | Under X, {\it type} defaults to wxBITMAP\_TYPE\_XPM. |
a660d684 KB |
126 | |
127 | \wxheading{See also} | |
128 | ||
129 | \helpref{wxBitmap::LoadFile}{wxbitmaploadfile} | |
130 | ||
06d20283 RD |
131 | \pythonnote{Constructors supported by wxPython are:\par |
132 | \indented{2cm}{\begin{twocollist} | |
133 | \twocolitem{\bf{wxBitmap(name, flag)}}{Loads a bitmap from a file} | |
134 | \twocolitem{\bf{wxNoRefBitmap(name, flag)}}{This one won't own the | |
135 | reference, so Python won't call the destructor, this is good for toolbars | |
136 | and such where the parent will manage the bitmap.} | |
137 | \twocolitem{\bf{wxEmptyBitmap(width, height, depth=-1)}}{Creates an | |
138 | empty bitmap with the given specifications} | |
139 | \end{twocollist}} | |
140 | } | |
141 | ||
a660d684 KB |
142 | \membersection{wxBitmap::\destruct{wxBitmap}} |
143 | ||
144 | \func{}{\destruct{wxBitmap}}{\void} | |
145 | ||
146 | Destroys the wxBitmap object and possibly the underlying bitmap data. | |
147 | Because reference counting is used, the bitmap may not actually be | |
148 | destroyed at this point - only when the reference count is zero will the | |
149 | data be deleted. | |
150 | ||
151 | If the application omits to delete the bitmap explicitly, the bitmap will be | |
152 | destroyed automatically by wxWindows when the application exits. | |
153 | ||
154 | Do not delete a bitmap that is selected into a memory device context. | |
155 | ||
156 | \membersection{wxBitmap::AddHandler}\label{wxbitmapaddhandler} | |
157 | ||
158 | \func{static void}{AddHandler}{\param{wxBitmapHandler*}{ handler}} | |
159 | ||
160 | Adds a handler to the end of the static list of format handlers. | |
161 | ||
162 | \docparam{handler}{A new bitmap format handler object. There is usually only one instance | |
163 | of a given handler class in an application session.} | |
164 | ||
165 | \wxheading{See also} | |
166 | ||
167 | \helpref{wxBitmapHandler}{wxbitmaphandler} | |
168 | ||
169 | \membersection{wxBitmap::CleanUpHandlers} | |
170 | ||
171 | \func{static void}{CleanUpHandlers}{\void} | |
172 | ||
173 | Deletes all bitmap handlers. | |
174 | ||
175 | This function is called by wxWindows on exit. | |
176 | ||
177 | \membersection{wxBitmap::Create} | |
178 | ||
eaaa6a06 | 179 | \func{virtual bool}{Create}{\param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} |
a660d684 KB |
180 | |
181 | Creates a fresh bitmap. If the final argument is omitted, the display depth of | |
182 | the screen is used. | |
183 | ||
eaaa6a06 | 184 | \func{virtual bool}{Create}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} |
a660d684 KB |
185 | |
186 | Creates a bitmap from the given data, which can be of arbitrary type. | |
187 | ||
188 | \wxheading{Parameters} | |
189 | ||
190 | \docparam{width}{The width of the bitmap in pixels.} | |
191 | ||
192 | \docparam{height}{The height of the bitmap in pixels.} | |
193 | ||
194 | \docparam{depth}{The depth of the bitmap in pixels. If this is -1, the screen depth is used.} | |
195 | ||
196 | \docparam{data}{Data whose type depends on the value of {\it type}.} | |
197 | ||
198 | \docparam{type}{A bitmap type identifier - see \helpref{wxBitmap::wxBitmap}{wxbitmapconstr} for a list | |
199 | of possible values.} | |
200 | ||
201 | \wxheading{Return value} | |
202 | ||
203 | TRUE if the call succeeded, FALSE otherwise. | |
204 | ||
205 | \wxheading{Remarks} | |
206 | ||
207 | The first form works on all platforms. The portability of the second form depends on the | |
208 | type of data. | |
209 | ||
210 | \wxheading{See also} | |
211 | ||
212 | \helpref{wxBitmap::wxBitmap}{wxbitmapconstr} | |
213 | ||
214 | \membersection{wxBitmap::FindHandler} | |
215 | ||
216 | \func{static wxBitmapHandler*}{FindHandler}{\param{const wxString\& }{name}} | |
217 | ||
218 | Finds the handler with the given name. | |
219 | ||
220 | \func{static wxBitmapHandler*}{FindHandler}{\param{const wxString\& }{extension}, \param{long}{ bitmapType}} | |
221 | ||
222 | Finds the handler associated with the given extension and type. | |
223 | ||
224 | \func{static wxBitmapHandler*}{FindHandler}{\param{long }{bitmapType}} | |
225 | ||
226 | Finds the handler associated with the given bitmap type. | |
227 | ||
228 | \docparam{name}{The handler name.} | |
229 | ||
230 | \docparam{extension}{The file extension, such as ``bmp".} | |
231 | ||
232 | \docparam{bitmapType}{The bitmap type, such as wxBITMAP\_TYPE\_BMP.} | |
233 | ||
234 | \wxheading{Return value} | |
235 | ||
236 | A pointer to the handler if found, NULL otherwise. | |
237 | ||
238 | \wxheading{See also} | |
239 | ||
240 | \helpref{wxBitmapHandler}{wxbitmaphandler} | |
241 | ||
242 | \membersection{wxBitmap::GetDepth} | |
243 | ||
244 | \constfunc{int}{GetDepth}{\void} | |
245 | ||
246 | Gets the colour depth of the bitmap. A value of 1 indicates a | |
247 | monochrome bitmap. | |
248 | ||
249 | \membersection{wxBitmap::GetHandlers} | |
250 | ||
251 | \func{static wxList\&}{GetHandlers}{\void} | |
252 | ||
253 | Returns the static list of bitmap format handlers. | |
254 | ||
255 | \wxheading{See also} | |
256 | ||
257 | \helpref{wxBitmapHandler}{wxbitmaphandler} | |
258 | ||
259 | \membersection{wxBitmap::GetHeight}\label{wxbitmapgetheight} | |
260 | ||
261 | \constfunc{int}{GetHeight}{\void} | |
262 | ||
263 | Gets the height of the bitmap in pixels. | |
264 | ||
265 | \membersection{wxBitmap::GetPalette}\label{wxbitmapgetpalette} | |
266 | ||
267 | \constfunc{wxPalette*}{GetPalette}{\void} | |
268 | ||
269 | Gets the associated palette (if any) which may have been loaded from a file | |
270 | or set for the bitmap. | |
271 | ||
272 | \wxheading{See also} | |
273 | ||
274 | \helpref{wxPalette}{wxpalette} | |
275 | ||
276 | \membersection{wxBitmap::GetMask}\label{wxbitmapgetmask} | |
277 | ||
278 | \constfunc{wxMask*}{GetMask}{\void} | |
279 | ||
1e6d9499 | 280 | Gets the associated mask (if any) which may have been loaded from a file |
a660d684 KB |
281 | or set for the bitmap. |
282 | ||
283 | \wxheading{See also} | |
284 | ||
285 | \helpref{wxBitmap::SetMask}{wxbitmapsetmask}, \helpref{wxMask}{wxmask} | |
286 | ||
287 | \membersection{wxBitmap::GetWidth}\label{wxbitmapgetwidth} | |
288 | ||
289 | \constfunc{int}{GetWidth}{\void} | |
290 | ||
291 | Gets the width of the bitmap in pixels. | |
292 | ||
293 | \wxheading{See also} | |
294 | ||
295 | \helpref{wxBitmap::GetHeight}{wxbitmapgetheight} | |
296 | ||
297 | \membersection{wxBitmap::InitStandardHandlers} | |
298 | ||
299 | \func{static void}{InitStandardHandlers}{\void} | |
300 | ||
301 | Adds the standard bitmap format handlers, which, depending on wxWindows | |
302 | configuration, can be handlers for Windows bitmap, Windows bitmap resource, and XPM. | |
303 | ||
304 | This function is called by wxWindows on startup. | |
305 | ||
306 | \wxheading{See also} | |
307 | ||
308 | \helpref{wxBitmapHandler}{wxbitmaphandler} | |
309 | ||
310 | \membersection{wxBitmap::InsertHandler} | |
311 | ||
312 | \func{static void}{InsertHandler}{\param{wxBitmapHandler*}{ handler}} | |
313 | ||
314 | Adds a handler at the start of the static list of format handlers. | |
315 | ||
316 | \docparam{handler}{A new bitmap format handler object. There is usually only one instance | |
317 | of a given handler class in an application session.} | |
318 | ||
319 | \wxheading{See also} | |
320 | ||
321 | \helpref{wxBitmapHandler}{wxbitmaphandler} | |
322 | ||
323 | \membersection{wxBitmap::LoadFile}\label{wxbitmaploadfile} | |
324 | ||
eaaa6a06 | 325 | \func{bool}{LoadFile}{\param{const wxString\&}{ name}, \param{long}{ type}} |
a660d684 KB |
326 | |
327 | Loads a bitmap from a file or resource. | |
328 | ||
329 | \wxheading{Parameters} | |
330 | ||
331 | \docparam{name}{Either a filename or a Windows resource name. | |
332 | The meaning of {\it name} is determined by the {\it type} parameter.} | |
333 | ||
334 | \docparam{type}{One of the following values: | |
335 | ||
336 | \twocolwidtha{5cm} | |
337 | \begin{twocollist} | |
338 | \twocolitem{{\bf wxBITMAP\_TYPE\_BMP}}{Load a Windows bitmap file.} | |
339 | \twocolitem{{\bf wxBITMAP\_TYPE\_BMP\_RESOURCE}}{Load a Windows bitmap from the resource database.} | |
340 | \twocolitem{{\bf wxBITMAP\_TYPE\_GIF}}{Load a GIF bitmap file.} | |
341 | \twocolitem{{\bf wxBITMAP\_TYPE\_XBM}}{Load an X bitmap file.} | |
342 | \twocolitem{{\bf wxBITMAP\_TYPE\_XPM}}{Load an XPM bitmap file.} | |
343 | \end{twocollist} | |
344 | ||
345 | The validity of these flags depends on the platform and wxWindows configuration.} | |
346 | ||
347 | \wxheading{Return value} | |
348 | ||
349 | TRUE if the operation succeeded, FALSE otherwise. | |
350 | ||
351 | \wxheading{Remarks} | |
352 | ||
353 | A palette may be associated with the bitmap if one exists (especially for | |
354 | colour Windows bitmaps), and if the code supports it. You can check | |
355 | if one has been created by using the \helpref{GetPalette}{wxbitmapgetpalette} member. | |
356 | ||
357 | \wxheading{See also} | |
358 | ||
359 | \helpref{wxBitmap::SaveFile}{wxbitmapsavefile} | |
360 | ||
361 | \membersection{wxBitmap::Ok}\label{wxbitmapok} | |
362 | ||
363 | \constfunc{bool}{Ok}{\void} | |
364 | ||
365 | Returns TRUE if bitmap data is present. | |
366 | ||
367 | \membersection{wxBitmap::RemoveHandler} | |
368 | ||
369 | \func{static bool}{RemoveHandler}{\param{const wxString\& }{name}} | |
370 | ||
371 | Finds the handler with the given name, and removes it. The handler | |
372 | is not deleted. | |
373 | ||
374 | \docparam{name}{The handler name.} | |
375 | ||
376 | \wxheading{Return value} | |
377 | ||
378 | TRUE if the handler was found and removed, FALSE otherwise. | |
379 | ||
380 | \wxheading{See also} | |
381 | ||
382 | \helpref{wxBitmapHandler}{wxbitmaphandler} | |
383 | ||
384 | \membersection{wxBitmap::SaveFile}\label{wxbitmapsavefile} | |
385 | ||
386 | \func{bool}{SaveFile}{\param{const wxString\& }{name}, \param{int}{ type}, \param{wxPalette* }{palette = NULL}} | |
387 | ||
388 | Saves a bitmap in the named file. | |
389 | ||
390 | \wxheading{Parameters} | |
391 | ||
392 | \docparam{name}{A filename. The meaning of {\it name} is determined by the {\it type} parameter.} | |
393 | ||
394 | \docparam{type}{One of the following values: | |
395 | ||
396 | \twocolwidtha{5cm} | |
397 | \begin{twocollist} | |
398 | \twocolitem{{\bf wxBITMAP\_TYPE\_BMP}}{Save a Windows bitmap file.} | |
399 | \twocolitem{{\bf wxBITMAP\_TYPE\_GIF}}{Save a GIF bitmap file.} | |
400 | \twocolitem{{\bf wxBITMAP\_TYPE\_XBM}}{Save an X bitmap file.} | |
401 | \twocolitem{{\bf wxBITMAP\_TYPE\_XPM}}{Save an XPM bitmap file.} | |
402 | \end{twocollist} | |
403 | ||
404 | The validity of these flags depends on the platform and wxWindows configuration.} | |
405 | ||
5b6aa0ff JS |
406 | \docparam{palette}{An optional palette used for saving the bitmap.} |
407 | % TODO: this parameter should | |
408 | %probably be eliminated; instead the app should set the palette before saving. | |
a660d684 KB |
409 | |
410 | \wxheading{Return value} | |
411 | ||
412 | TRUE if the operation succeeded, FALSE otherwise. | |
413 | ||
414 | \wxheading{Remarks} | |
415 | ||
416 | Depending on how wxWindows has been configured, not all formats may be available. | |
417 | ||
418 | \wxheading{See also} | |
419 | ||
420 | \helpref{wxBitmap::LoadFile}{wxbitmaploadfile} | |
421 | ||
422 | \membersection{wxBitmap::SetDepth}\label{wxbitmapsetdepth} | |
423 | ||
424 | \func{void}{SetDepth}{\param{int }{depth}} | |
425 | ||
426 | Sets the depth member (does not affect the bitmap data). | |
427 | ||
428 | \wxheading{Parameters} | |
429 | ||
430 | \docparam{depth}{Bitmap depth.} | |
431 | ||
432 | \membersection{wxBitmap::SetHeight}\label{wxbitmapsetheight} | |
433 | ||
434 | \func{void}{SetHeight}{\param{int }{height}} | |
435 | ||
436 | Sets the height member (does not affect the bitmap data). | |
437 | ||
438 | \wxheading{Parameters} | |
439 | ||
440 | \docparam{height}{Bitmap height in pixels.} | |
441 | ||
442 | \membersection{wxBitmap::SetMask}\label{wxbitmapsetmask} | |
443 | ||
444 | \func{void}{SetMask}{\param{wxMask* }{mask}} | |
445 | ||
446 | Sets the mask for this bitmap. | |
447 | ||
448 | \wxheading{Remarks} | |
449 | ||
450 | The bitmap object owns the mask once this has been called. | |
451 | ||
452 | \wxheading{See also} | |
453 | ||
454 | \helpref{wxBitmap::GetMask}{wxbitmapgetmask}, \helpref{wxMask}{wxmask} | |
455 | ||
456 | \membersection{wxBitmap::SetOk} | |
457 | ||
458 | \func{void}{SetOk}{\param{int }{isOk}} | |
459 | ||
460 | Sets the validity member (does not affect the bitmap data). | |
461 | ||
462 | \wxheading{Parameters} | |
463 | ||
464 | \docparam{isOk}{Validity flag.} | |
465 | ||
466 | \membersection{wxBitmap::SetPalette}\label{wxbitmapsetpalette} | |
467 | ||
468 | \func{void}{SetPalette}{\param{wxPalette* }{palette}} | |
469 | ||
470 | Sets the associated palette: it will be deleted in the wxBitmap | |
471 | destructor, so if you do not wish it to be deleted automatically, | |
472 | reset the palette to NULL before the bitmap is deleted. | |
473 | ||
474 | \wxheading{Parameters} | |
475 | ||
476 | \docparam{palette}{The palette to set.} | |
477 | ||
478 | \wxheading{Remarks} | |
479 | ||
480 | The bitmap object owns the palette once this has been called. | |
481 | ||
482 | \wxheading{See also} | |
483 | ||
484 | \helpref{wxPalette}{wxpalette} | |
485 | ||
486 | \membersection{wxBitmap::SetWidth} | |
487 | ||
488 | \func{void}{SetWidth}{\param{int }{width}} | |
489 | ||
490 | Sets the width member (does not affect the bitmap data). | |
491 | ||
492 | \wxheading{Parameters} | |
493 | ||
494 | \docparam{width}{Bitmap width in pixels.} | |
495 | ||
496 | \membersection{wxBitmap::operator $=$} | |
497 | ||
498 | \func{wxBitmap\& }{operator $=$}{\param{const wxBitmap\& }{bitmap}} | |
499 | ||
500 | Assignment operator. This operator does not copy any data, but instead | |
501 | passes a pointer to the data in {\it bitmap} and increments a reference | |
502 | counter. It is a fast operation. | |
503 | ||
504 | \wxheading{Parameters} | |
505 | ||
506 | \docparam{bitmap}{Bitmap to assign.} | |
507 | ||
508 | \wxheading{Return value} | |
509 | ||
510 | Returns 'this' object. | |
511 | ||
512 | \membersection{wxBitmap::operator $==$} | |
513 | ||
514 | \func{bool}{operator $==$}{\param{const wxBitmap\& }{bitmap}} | |
515 | ||
516 | Equality operator. This operator tests whether the internal data pointers are | |
517 | equal (a fast test). | |
518 | ||
519 | \wxheading{Parameters} | |
520 | ||
521 | \docparam{bitmap}{Bitmap to compare with 'this'} | |
522 | ||
523 | \wxheading{Return value} | |
524 | ||
525 | Returns TRUE if the bitmaps were effectively equal, FALSE otherwise. | |
526 | ||
527 | \membersection{wxBitmap::operator $!=$} | |
528 | ||
529 | \func{bool}{operator $!=$}{\param{const wxBitmap\& }{bitmap}} | |
530 | ||
531 | Inequality operator. This operator tests whether the internal data pointers are | |
532 | unequal (a fast test). | |
533 | ||
534 | \wxheading{Parameters} | |
535 | ||
536 | \docparam{bitmap}{Bitmap to compare with 'this'} | |
537 | ||
538 | \wxheading{Return value} | |
539 | ||
540 | Returns TRUE if the bitmaps were unequal, FALSE otherwise. | |
541 | ||
542 | \section{\class{wxBitmapHandler}}\label{wxbitmaphandler} | |
543 | ||
544 | \overview{Overview}{wxbitmapoverview} | |
545 | ||
546 | This is the base class for implementing bitmap file loading/saving, and bitmap creation from data. | |
547 | It is used within wxBitmap and is not normally seen by the application. | |
548 | ||
549 | If you wish to extend the capabilities of wxBitmap, derive a class from wxBitmapHandler | |
550 | and add the handler using \helpref{wxBitmap::AddHandler}{wxbitmapaddhandler} in your | |
551 | application initialisation. | |
552 | ||
553 | \wxheading{Derived from} | |
554 | ||
555 | \helpref{wxObject}{wxobject} | |
556 | ||
954b8ae6 JS |
557 | \wxheading{Include files} |
558 | ||
559 | <wx/bitmap.h> | |
560 | ||
a660d684 KB |
561 | \wxheading{See also} |
562 | ||
563 | \helpref{wxBitmap}{wxbitmap}, \helpref{wxIcon}{wxicon}, \helpref{wxCursor}{wxcursor} | |
564 | ||
565 | \latexignore{\rtfignore{\wxheading{Members}}} | |
566 | ||
567 | \membersection{wxBitmapHandler::wxBitmapHandler}\label{wxbitmaphandlerconstr} | |
568 | ||
569 | \func{}{wxBitmapHandler}{\void} | |
570 | ||
571 | Default constructor. In your own default constructor, initialise the members | |
572 | m\_name, m\_extension and m\_type. | |
573 | ||
574 | \membersection{wxBitmapHandler::\destruct{wxBitmapHandler}} | |
575 | ||
576 | \func{}{\destruct{wxBitmapHandler}}{\void} | |
577 | ||
578 | Destroys the wxBitmapHandler object. | |
579 | ||
580 | \membersection{wxBitmapHandler::Create} | |
581 | ||
eaaa6a06 | 582 | \func{virtual bool}{Create}{\param{wxBitmap* }{bitmap}, \param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} |
a660d684 KB |
583 | |
584 | Creates a bitmap from the given data, which can be of arbitrary type. The wxBitmap object {\it bitmap} is | |
585 | manipulated by this function. | |
586 | ||
587 | \wxheading{Parameters} | |
588 | ||
589 | \docparam{bitmap}{The wxBitmap object.} | |
590 | ||
591 | \docparam{width}{The width of the bitmap in pixels.} | |
592 | ||
593 | \docparam{height}{The height of the bitmap in pixels.} | |
594 | ||
595 | \docparam{depth}{The depth of the bitmap in pixels. If this is -1, the screen depth is used.} | |
596 | ||
597 | \docparam{data}{Data whose type depends on the value of {\it type}.} | |
598 | ||
599 | \docparam{type}{A bitmap type identifier - see \helpref{wxBitmapHandler::wxBitmapHandler}{wxbitmapconstr} for a list | |
600 | of possible values.} | |
601 | ||
602 | \wxheading{Return value} | |
603 | ||
604 | TRUE if the call succeeded, FALSE otherwise (the default). | |
605 | ||
606 | \membersection{wxBitmapHandler::GetName} | |
607 | ||
608 | \constfunc{wxString}{GetName}{\void} | |
609 | ||
610 | Gets the name of this handler. | |
611 | ||
612 | \membersection{wxBitmapHandler::GetExtension} | |
613 | ||
614 | \constfunc{wxString}{GetExtension}{\void} | |
615 | ||
616 | Gets the file extension associated with this handler. | |
617 | ||
618 | \membersection{wxBitmapHandler::GetType} | |
619 | ||
620 | \constfunc{long}{GetType}{\void} | |
621 | ||
622 | Gets the bitmap type associated with this handler. | |
623 | ||
624 | \membersection{wxBitmapHandler::LoadFile}\label{wxbitmaphandlerloadfile} | |
625 | ||
eaaa6a06 | 626 | \func{bool}{LoadFile}{\param{wxBitmap* }{bitmap}, \param{const wxString\&}{ name}, \param{long}{ type}} |
a660d684 KB |
627 | |
628 | Loads a bitmap from a file or resource, putting the resulting data into {\it bitmap}. | |
629 | ||
630 | \wxheading{Parameters} | |
631 | ||
632 | \docparam{bitmap}{The bitmap object which is to be affected by this operation.} | |
633 | ||
634 | \docparam{name}{Either a filename or a Windows resource name. | |
635 | The meaning of {\it name} is determined by the {\it type} parameter.} | |
636 | ||
637 | \docparam{type}{See \helpref{wxBitmap::wxBitmap}{wxbitmapconstr} for values this can take.} | |
638 | ||
639 | \wxheading{Return value} | |
640 | ||
641 | TRUE if the operation succeeded, FALSE otherwise. | |
642 | ||
643 | \wxheading{See also} | |
644 | ||
645 | \helpref{wxBitmap::LoadFile}{wxbitmaploadfile}\\ | |
646 | \helpref{wxBitmap::SaveFile}{wxbitmapsavefile}\\ | |
647 | \helpref{wxBitmapHandler::SaveFile}{wxbitmaphandlersavefile} | |
648 | ||
649 | \membersection{wxBitmapHandler::SaveFile}\label{wxbitmaphandlersavefile} | |
650 | ||
651 | \func{bool}{SaveFile}{\param{wxBitmap* }{bitmap}, \param{const wxString\& }{name}, \param{int}{ type}, \param{wxPalette* }{palette = NULL}} | |
652 | ||
653 | Saves a bitmap in the named file. | |
654 | ||
655 | \wxheading{Parameters} | |
656 | ||
657 | \docparam{bitmap}{The bitmap object which is to be affected by this operation.} | |
658 | ||
659 | \docparam{name}{A filename. The meaning of {\it name} is determined by the {\it type} parameter.} | |
660 | ||
661 | \docparam{type}{See \helpref{wxBitmap::wxBitmap}{wxbitmapconstr} for values this can take.} | |
662 | ||
5b6aa0ff | 663 | \docparam{palette}{An optional palette used for saving the bitmap.} |
a660d684 KB |
664 | |
665 | \wxheading{Return value} | |
666 | ||
667 | TRUE if the operation succeeded, FALSE otherwise. | |
668 | ||
669 | \wxheading{See also} | |
670 | ||
671 | \helpref{wxBitmap::LoadFile}{wxbitmaploadfile}\\ | |
672 | \helpref{wxBitmap::SaveFile}{wxbitmapsavefile}\\ | |
673 | \helpref{wxBitmapHandler::LoadFile}{wxbitmaphandlerloadfile} | |
674 | ||
675 | \membersection{wxBitmapHandler::SetName} | |
676 | ||
677 | \func{void}{SetName}{\param{const wxString\& }{name}} | |
678 | ||
679 | Sets the handler name. | |
680 | ||
681 | \wxheading{Parameters} | |
682 | ||
683 | \docparam{name}{Handler name.} | |
684 | ||
685 | \membersection{wxBitmapHandler::SetExtension} | |
686 | ||
687 | \func{void}{SetExtension}{\param{const wxString\& }{extension}} | |
688 | ||
689 | Sets the handler extension. | |
690 | ||
691 | \wxheading{Parameters} | |
692 | ||
693 | \docparam{extension}{Handler extension.} | |
694 | ||
695 | \membersection{wxBitmapHandler::SetType} | |
696 | ||
697 | \func{void}{SetType}{\param{long }{type}} | |
698 | ||
699 | Sets the handler type. | |
700 | ||
701 | \wxheading{Parameters} | |
702 | ||
703 | \docparam{name}{Handler type.} | |
704 | ||
705 |