1 \section{\class{wxBitmapHandler
}}\label{wxbitmaphandler
}
3 \overview{Overview
}{wxbitmapoverview
}
5 This is the base class for implementing bitmap file loading/saving, and bitmap creation from data.
6 It is used within wxBitmap and is not normally seen by the application.
8 If you wish to extend the capabilities of wxBitmap, derive a class from wxBitmapHandler
9 and add the handler using
\helpref{wxBitmap::AddHandler
}{wxbitmapaddhandler
} in your
10 application initialisation.
12 \wxheading{Derived from
}
14 \helpref{wxObject
}{wxobject
}
16 \wxheading{Include files
}
22 \helpref{wxBitmap
}{wxbitmap
},
\helpref{wxIcon
}{wxicon
},
\helpref{wxCursor
}{wxcursor
}
24 \latexignore{\rtfignore{\wxheading{Members
}}}
26 \membersection{wxBitmapHandler::wxBitmapHandler
}\label{wxbitmaphandlerconstr
}
28 \func{}{wxBitmapHandler
}{\void}
30 Default constructor. In your own default constructor, initialise the members
31 m
\_name, m
\_extension and m
\_type.
33 \membersection{wxBitmapHandler::
\destruct{wxBitmapHandler
}}
35 \func{}{\destruct{wxBitmapHandler
}}{\void}
37 Destroys the wxBitmapHandler object.
39 \membersection{wxBitmapHandler::Create
}
41 \func{virtual bool
}{Create
}{\param{wxBitmap*
}{bitmap
},
\param{void*
}{ data
},
\param{int
}{ type
},
\param{int
}{ width
},
\param{int
}{ height
},
\param{int
}{ depth = -
1}}
43 Creates a bitmap from the given data, which can be of arbitrary type. The wxBitmap object
{\it bitmap
} is
44 manipulated by this function.
46 \wxheading{Parameters
}
48 \docparam{bitmap
}{The wxBitmap object.
}
50 \docparam{width
}{The width of the bitmap in pixels.
}
52 \docparam{height
}{The height of the bitmap in pixels.
}
54 \docparam{depth
}{The depth of the bitmap in pixels. If this is -
1, the screen depth is used.
}
56 \docparam{data
}{Data whose type depends on the value of
{\it type
}.
}
58 \docparam{type
}{A bitmap type identifier - see
\helpref{wxBitmapHandler::wxBitmapHandler
}{wxbitmapconstr
} for a list
61 \wxheading{Return value
}
63 true if the call succeeded, false otherwise (the default).
65 \membersection{wxBitmapHandler::GetName
}
67 \constfunc{wxString
}{GetName
}{\void}
69 Gets the name of this handler.
71 \membersection{wxBitmapHandler::GetExtension
}
73 \constfunc{wxString
}{GetExtension
}{\void}
75 Gets the file extension associated with this handler.
77 \membersection{wxBitmapHandler::GetType
}
79 \constfunc{long
}{GetType
}{\void}
81 Gets the bitmap type associated with this handler.
83 \membersection{wxBitmapHandler::LoadFile
}\label{wxbitmaphandlerloadfile
}
85 \func{bool
}{LoadFile
}{\param{wxBitmap*
}{bitmap
},
\param{const wxString\&
}{ name
},
\param{long
}{ type
}}
87 Loads a bitmap from a file or resource, putting the resulting data into
{\it bitmap
}.
89 \wxheading{Parameters
}
91 \docparam{bitmap
}{The bitmap object which is to be affected by this operation.
}
93 \docparam{name
}{Either a filename or a Windows resource name.
94 The meaning of
{\it name
} is determined by the
{\it type
} parameter.
}
96 \docparam{type
}{See
\helpref{wxBitmap::wxBitmap
}{wxbitmapconstr
} for values this can take.
}
98 \wxheading{Return value
}
100 true if the operation succeeded, false otherwise.
104 \helpref{wxBitmap::LoadFile
}{wxbitmaploadfile
}\\
105 \helpref{wxBitmap::SaveFile
}{wxbitmapsavefile
}\\
106 \helpref{wxBitmapHandler::SaveFile
}{wxbitmaphandlersavefile
}
108 \membersection{wxBitmapHandler::SaveFile
}\label{wxbitmaphandlersavefile
}
110 \func{bool
}{SaveFile
}{\param{wxBitmap*
}{bitmap
},
\param{const wxString\&
}{name
},
\param{int
}{ type
},
\param{wxPalette*
}{palette = NULL
}}
112 Saves a bitmap in the named file.
114 \wxheading{Parameters
}
116 \docparam{bitmap
}{The bitmap object which is to be affected by this operation.
}
118 \docparam{name
}{A filename. The meaning of
{\it name
} is determined by the
{\it type
} parameter.
}
120 \docparam{type
}{See
\helpref{wxBitmap::wxBitmap
}{wxbitmapconstr
} for values this can take.
}
122 \docparam{palette
}{An optional palette used for saving the bitmap.
}
124 \wxheading{Return value
}
126 true if the operation succeeded, false otherwise.
130 \helpref{wxBitmap::LoadFile
}{wxbitmaploadfile
}\\
131 \helpref{wxBitmap::SaveFile
}{wxbitmapsavefile
}\\
132 \helpref{wxBitmapHandler::LoadFile
}{wxbitmaphandlerloadfile
}
134 \membersection{wxBitmapHandler::SetName
}
136 \func{void
}{SetName
}{\param{const wxString\&
}{name
}}
138 Sets the handler name.
140 \wxheading{Parameters
}
142 \docparam{name
}{Handler name.
}
144 \membersection{wxBitmapHandler::SetExtension
}
146 \func{void
}{SetExtension
}{\param{const wxString\&
}{extension
}}
148 Sets the handler extension.
150 \wxheading{Parameters
}
152 \docparam{extension
}{Handler extension.
}
154 \membersection{wxBitmapHandler::SetType
}
156 \func{void
}{SetType
}{\param{long
}{type
}}
158 Sets the handler type.
160 \wxheading{Parameters
}
162 \docparam{name
}{Handler type.
}