]>
Commit | Line | Data |
---|---|---|
f6106dae VZ |
1 | \section{\class{wxBitmapHandler}}\label{wxbitmaphandler} |
2 | ||
3 | \overview{Overview}{wxbitmapoverview} | |
4 | ||
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. | |
7 | ||
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. | |
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{wxbitmaphandlerconstr} | |
27 | ||
28 | \func{}{wxBitmapHandler}{\void} | |
29 | ||
30 | Default constructor. In your own default constructor, initialise the members | |
31 | m\_name, m\_extension and m\_type. | |
32 | ||
33 | \membersection{wxBitmapHandler::\destruct{wxBitmapHandler}} | |
34 | ||
35 | \func{}{\destruct{wxBitmapHandler}}{\void} | |
36 | ||
37 | Destroys the wxBitmapHandler object. | |
38 | ||
39 | \membersection{wxBitmapHandler::Create} | |
40 | ||
41 | \func{virtual bool}{Create}{\param{wxBitmap* }{bitmap}, \param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} | |
42 | ||
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. | |
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}{wxbitmapconstr} for a list | |
59 | of possible values.} | |
60 | ||
61 | \wxheading{Return value} | |
62 | ||
63 | TRUE if the call succeeded, FALSE otherwise (the default). | |
64 | ||
65 | \membersection{wxBitmapHandler::GetName} | |
66 | ||
67 | \constfunc{wxString}{GetName}{\void} | |
68 | ||
69 | Gets the name of this handler. | |
70 | ||
71 | \membersection{wxBitmapHandler::GetExtension} | |
72 | ||
73 | \constfunc{wxString}{GetExtension}{\void} | |
74 | ||
75 | Gets the file extension associated with this handler. | |
76 | ||
77 | \membersection{wxBitmapHandler::GetType} | |
78 | ||
79 | \constfunc{long}{GetType}{\void} | |
80 | ||
81 | Gets 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 | ||
87 | Loads 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. | |
94 | The meaning of {\it name} is determined by the {\it type} parameter.} | |
95 | ||
96 | \docparam{type}{See \helpref{wxBitmap::wxBitmap}{wxbitmapconstr} for values this can take.} | |
97 | ||
98 | \wxheading{Return value} | |
99 | ||
100 | TRUE 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 | ||
112 | Saves 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}{wxbitmapconstr} for values this can take.} | |
121 | ||
122 | \docparam{palette}{An optional palette used for saving the bitmap.} | |
123 | ||
124 | \wxheading{Return value} | |
125 | ||
126 | TRUE 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} | |
135 | ||
136 | \func{void}{SetName}{\param{const wxString\& }{name}} | |
137 | ||
138 | Sets the handler name. | |
139 | ||
140 | \wxheading{Parameters} | |
141 | ||
142 | \docparam{name}{Handler name.} | |
143 | ||
144 | \membersection{wxBitmapHandler::SetExtension} | |
145 | ||
146 | \func{void}{SetExtension}{\param{const wxString\& }{extension}} | |
147 | ||
148 | Sets the handler extension. | |
149 | ||
150 | \wxheading{Parameters} | |
151 | ||
152 | \docparam{extension}{Handler extension.} | |
153 | ||
154 | \membersection{wxBitmapHandler::SetType} | |
155 | ||
156 | \func{void}{SetType}{\param{long }{type}} | |
157 | ||
158 | Sets the handler type. | |
159 | ||
160 | \wxheading{Parameters} | |
161 | ||
162 | \docparam{name}{Handler type.} | |
163 | ||
164 | ||
165 |