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{wxCore
}{librarieslist
}
26 \helpref{wxBitmap
}{wxbitmap
},
\helpref{wxIcon
}{wxicon
},
\helpref{wxCursor
}{wxcursor
}
28 \latexignore{\rtfignore{\wxheading{Members
}}}
30 \membersection{wxBitmapHandler::wxBitmapHandler
}\label{wxbitmaphandlerctor
}
32 \func{}{wxBitmapHandler
}{\void}
34 Default constructor. In your own default constructor, initialise the members
35 m
\_name, m
\_extension and m
\_type.
37 \membersection{wxBitmapHandler::
\destruct{wxBitmapHandler
}}\label{wxbitmaphandlerdtor
}
39 \func{}{\destruct{wxBitmapHandler
}}{\void}
41 Destroys the wxBitmapHandler object.
43 \membersection{wxBitmapHandler::Create
}\label{wxbitmaphandlercreate
}
45 \func{virtual bool
}{Create
}{\param{wxBitmap*
}{bitmap
},
\param{const void*
}{ data
},
\param{int
}{ type
},
\param{int
}{ width
},
\param{int
}{ height
},
\param{int
}{ depth = -
1}}
47 Creates a bitmap from the given data, which can be of arbitrary type. The wxBitmap object
{\it bitmap
} is
48 manipulated by this function.
50 \wxheading{Parameters
}
52 \docparam{bitmap
}{The wxBitmap object.
}
54 \docparam{width
}{The width of the bitmap in pixels.
}
56 \docparam{height
}{The height of the bitmap in pixels.
}
58 \docparam{depth
}{The depth of the bitmap in pixels. If this is -
1, the screen depth is used.
}
60 \docparam{data
}{Data whose type depends on the value of
{\it type
}.
}
62 \docparam{type
}{A bitmap type identifier - see
\helpref{wxBitmapHandler::wxBitmapHandler
}{wxbitmapctor
} for a list
65 \wxheading{Return value
}
67 true if the call succeeded, false otherwise (the default).
69 \membersection{wxBitmapHandler::GetName
}\label{wxbitmaphandlergetname
}
71 \constfunc{const wxString\&
}{ GetName
}{\void}
73 Gets the name of this handler.
75 \membersection{wxBitmapHandler::GetExtension
}\label{wxbitmaphandlergetextension
}
77 \constfunc{const wxString\&
}{ GetExtension
}{\void}
79 Gets the file extension associated with this handler.
81 \membersection{wxBitmapHandler::GetType
}\label{wxbitmaphandlergettype
}
83 \constfunc{long
}{GetType
}{\void}
85 Gets the bitmap type associated with this handler.
87 \membersection{wxBitmapHandler::LoadFile
}\label{wxbitmaphandlerloadfile
}
89 \func{bool
}{LoadFile
}{\param{wxBitmap*
}{bitmap
},
\param{const wxString\&
}{ name
},
\param{long
}{ type
}}
91 Loads a bitmap from a file or resource, putting the resulting data into
{\it bitmap
}.
93 \wxheading{Parameters
}
95 \docparam{bitmap
}{The bitmap object which is to be affected by this operation.
}
97 \docparam{name
}{Either a filename or a Windows resource name.
98 The meaning of
{\it name
} is determined by the
{\it type
} parameter.
}
100 \docparam{type
}{See
\helpref{wxBitmap::wxBitmap
}{wxbitmapctor
} for values this can take.
}
102 \wxheading{Return value
}
104 true if the operation succeeded, false otherwise.
108 \helpref{wxBitmap::LoadFile
}{wxbitmaploadfile
}\\
109 \helpref{wxBitmap::SaveFile
}{wxbitmapsavefile
}\\
110 \helpref{wxBitmapHandler::SaveFile
}{wxbitmaphandlersavefile
}
112 \membersection{wxBitmapHandler::SaveFile
}\label{wxbitmaphandlersavefile
}
114 \func{bool
}{SaveFile
}{\param{wxBitmap*
}{bitmap
},
\param{const wxString\&
}{name
},
\param{int
}{ type
},
\param{wxPalette*
}{palette = NULL
}}
116 Saves a bitmap in the named file.
118 \wxheading{Parameters
}
120 \docparam{bitmap
}{The bitmap object which is to be affected by this operation.
}
122 \docparam{name
}{A filename. The meaning of
{\it name
} is determined by the
{\it type
} parameter.
}
124 \docparam{type
}{See
\helpref{wxBitmap::wxBitmap
}{wxbitmapctor
} for values this can take.
}
126 \docparam{palette
}{An optional palette used for saving the bitmap.
}
128 \wxheading{Return value
}
130 true if the operation succeeded, false otherwise.
134 \helpref{wxBitmap::LoadFile
}{wxbitmaploadfile
}\\
135 \helpref{wxBitmap::SaveFile
}{wxbitmapsavefile
}\\
136 \helpref{wxBitmapHandler::LoadFile
}{wxbitmaphandlerloadfile
}
138 \membersection{wxBitmapHandler::SetName
}\label{wxbitmaphandlersetname
}
140 \func{void
}{SetName
}{\param{const wxString\&
}{name
}}
142 Sets the handler name.
144 \wxheading{Parameters
}
146 \docparam{name
}{Handler name.
}
148 \membersection{wxBitmapHandler::SetExtension
}\label{wxbitmaphandlersetextension
}
150 \func{void
}{SetExtension
}{\param{const wxString\&
}{extension
}}
152 Sets the handler extension.
154 \wxheading{Parameters
}
156 \docparam{extension
}{Handler extension.
}
158 \membersection{wxBitmapHandler::SetType
}\label{wxbitmaphandlersettype
}
160 \func{void
}{SetType
}{\param{long
}{type
}}
162 Sets the handler type.
164 \wxheading{Parameters
}
166 \docparam{name
}{Handler type.
}