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