1\section{\class{wxBitmapHandler}}\label{wxbitmaphandler} 2 3\overview{Overview}{wxbitmapoverview} 4 5This is the base class for implementing bitmap file loading/saving, and bitmap creation from data. 6It is used within wxBitmap and is not normally seen by the application. 7 8If you wish to extend the capabilities of wxBitmap, derive a class from wxBitmapHandler 9and add the handler using \helpref{wxBitmap::AddHandler}{wxbitmapaddhandler} in your 10application initialisation. 11 12\wxheading{Derived from} 13 14\helpref{wxObject}{wxobject} 15 16\wxheading{Include files} 17 18<wx/bitmap.h> 19 20\wxheading{See also} 21 22\helpref{wxBitmap}{wxbitmap}, \helpref{wxIcon}{wxicon}, \helpref{wxCursor}{wxcursor} 23 24\latexignore{\rtfignore{\wxheading{Members}}} 25 26\membersection{wxBitmapHandler::wxBitmapHandler}\label{wxbitmaphandlerctor} 27 28\func{}{wxBitmapHandler}{\void} 29 30Default constructor. In your own default constructor, initialise the members 31m\_name, m\_extension and m\_type. 32 33\membersection{wxBitmapHandler::\destruct{wxBitmapHandler}}\label{wxbitmaphandlerdtor} 34 35\func{}{\destruct{wxBitmapHandler}}{\void} 36 37Destroys the wxBitmapHandler object. 38 39\membersection{wxBitmapHandler::Create}\label{wxbitmaphandlercreate} 40 41\func{virtual bool}{Create}{\param{wxBitmap* }{bitmap}, \param{const void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} 42 43Creates a bitmap from the given data, which can be of arbitrary type. The wxBitmap object {\it bitmap} is 44manipulated by this function. 45 46\wxheading{Parameters} 47 48\docparam{bitmap}{The wxBitmap object.} 49 50\docparam{width}{The width of the bitmap in pixels.} 51 52\docparam{height}{The height of the bitmap in pixels.} 53 54\docparam{depth}{The depth of the bitmap in pixels. If this is -1, the screen depth is used.} 55 56\docparam{data}{Data whose type depends on the value of {\it type}.} 57 58\docparam{type}{A bitmap type identifier - see \helpref{wxBitmapHandler::wxBitmapHandler}{wxbitmapctor} for a list 59of possible values.} 60 61\wxheading{Return value} 62 63true if the call succeeded, false otherwise (the default). 64 65\membersection{wxBitmapHandler::GetName}\label{wxbitmaphandlergetname} 66 67\constfunc{const wxString\&}{ GetName}{\void} 68 69Gets the name of this handler. 70 71\membersection{wxBitmapHandler::GetExtension}\label{wxbitmaphandlergetextension} 72 73\constfunc{const wxString\&}{ GetExtension}{\void} 74 75Gets the file extension associated with this handler. 76 77\membersection{wxBitmapHandler::GetType}\label{wxbitmaphandlergettype} 78 79\constfunc{long}{GetType}{\void} 80 81Gets the bitmap type associated with this handler. 82 83\membersection{wxBitmapHandler::LoadFile}\label{wxbitmaphandlerloadfile} 84 85\func{bool}{LoadFile}{\param{wxBitmap* }{bitmap}, \param{const wxString\&}{ name}, \param{long}{ type}} 86 87Loads a bitmap from a file or resource, putting the resulting data into {\it bitmap}. 88 89\wxheading{Parameters} 90 91\docparam{bitmap}{The bitmap object which is to be affected by this operation.} 92 93\docparam{name}{Either a filename or a Windows resource name. 94The meaning of {\it name} is determined by the {\it type} parameter.} 95 96\docparam{type}{See \helpref{wxBitmap::wxBitmap}{wxbitmapctor} for values this can take.} 97 98\wxheading{Return value} 99 100true if the operation succeeded, false otherwise. 101 102\wxheading{See also} 103 104\helpref{wxBitmap::LoadFile}{wxbitmaploadfile}\\ 105\helpref{wxBitmap::SaveFile}{wxbitmapsavefile}\\ 106\helpref{wxBitmapHandler::SaveFile}{wxbitmaphandlersavefile} 107 108\membersection{wxBitmapHandler::SaveFile}\label{wxbitmaphandlersavefile} 109 110\func{bool}{SaveFile}{\param{wxBitmap* }{bitmap}, \param{const wxString\& }{name}, \param{int}{ type}, \param{wxPalette* }{palette = NULL}} 111 112Saves a bitmap in the named file. 113 114\wxheading{Parameters} 115 116\docparam{bitmap}{The bitmap object which is to be affected by this operation.} 117 118\docparam{name}{A filename. The meaning of {\it name} is determined by the {\it type} parameter.} 119 120\docparam{type}{See \helpref{wxBitmap::wxBitmap}{wxbitmapctor} for values this can take.} 121 122\docparam{palette}{An optional palette used for saving the bitmap.} 123 124\wxheading{Return value} 125 126true if the operation succeeded, false otherwise. 127 128\wxheading{See also} 129 130\helpref{wxBitmap::LoadFile}{wxbitmaploadfile}\\ 131\helpref{wxBitmap::SaveFile}{wxbitmapsavefile}\\ 132\helpref{wxBitmapHandler::LoadFile}{wxbitmaphandlerloadfile} 133 134\membersection{wxBitmapHandler::SetName}\label{wxbitmaphandlersetname} 135 136\func{void}{SetName}{\param{const wxString\& }{name}} 137 138Sets the handler name. 139 140\wxheading{Parameters} 141 142\docparam{name}{Handler name.} 143 144\membersection{wxBitmapHandler::SetExtension}\label{wxbitmaphandlersetextension} 145 146\func{void}{SetExtension}{\param{const wxString\& }{extension}} 147 148Sets the handler extension. 149 150\wxheading{Parameters} 151 152\docparam{extension}{Handler extension.} 153 154\membersection{wxBitmapHandler::SetType}\label{wxbitmaphandlersettype} 155 156\func{void}{SetType}{\param{long }{type}} 157 158Sets the handler type. 159 160\wxheading{Parameters} 161 162\docparam{name}{Handler type.} 163 164 165 166