]>
Commit | Line | Data |
---|---|---|
1 | \section{\class{wxImage}}\label{wximage} | |
2 | ||
3 | This class encapsulates a platform-independent image. An image can be created | |
4 | from data, or using the constructor taking a wxBitmap object. An image | |
5 | can be loaded from a file in a variety of formats, and is extensible to new formats | |
6 | via image format handlers. Functions are available to set and get image bits, so | |
7 | it can be used for basic image manipulation. | |
8 | ||
9 | A wxImage cannot (currently) be drawn directly to a wxDC. Instead, a platform-specific | |
10 | wxBitmap object must be created from it, and that bitmap drawn on the wxDC, using | |
11 | wxDC::DrawBitmap. | |
12 | ||
13 | \wxheading{Derived from} | |
14 | ||
15 | \helpref{wxObject}{wxobject} | |
16 | ||
17 | \wxheading{Include files} | |
18 | ||
19 | <wx/image.h> | |
20 | ||
21 | \wxheading{See also} | |
22 | ||
23 | \helpref{wxBitmap}{wxbitmap} | |
24 | \helpref{wxInitAllImageHandlers}{wxinitallimagehandlers} | |
25 | ||
26 | \latexignore{\rtfignore{\wxheading{Members}}} | |
27 | ||
28 | \membersection{wxImage::wxImage}\label{wximageconstr} | |
29 | ||
30 | \func{}{wxImage}{\void} | |
31 | ||
32 | Default constructor. | |
33 | ||
34 | \func{}{wxImage}{\param{const wxImage\& }{image}} | |
35 | ||
36 | Copy constructor. | |
37 | ||
38 | \func{}{wxImage}{\param{const wxBitmap\&}{ bitmap}} | |
39 | ||
40 | Constructs an image from a platform-dependent bitmap. This preserves | |
41 | mask information so that bitmaps and images can be converted back | |
42 | and forth without loss in that respect. | |
43 | ||
44 | \func{}{wxImage}{\param{int}{ width}, \param{int}{ height}} | |
45 | ||
46 | Creates an image with the given width and height. | |
47 | ||
48 | \func{}{wxImage}{\param{const wxString\& }{name}, \param{long}{ type = wxBITMAP\_TYPE\_PNG}} | |
49 | ||
50 | \func{}{wxImage}{\param{const wxString\& }{name}, \param{const wxString\&}{ mimetype}} | |
51 | ||
52 | Loads an image from a file. | |
53 | ||
54 | \func{}{wxImage}{\param{wxInputStream\& }{stream}, \param{long}{ type = wxBITMAP\_TYPE\_PNG}} | |
55 | ||
56 | \func{}{wxImage}{\param{wxInputStream\& }{stream}, \param{const wxString\&}{ mimetype}} | |
57 | ||
58 | Loads an image from an input stream. | |
59 | ||
60 | \wxheading{Parameters} | |
61 | ||
62 | \docparam{width}{Specifies the width of the image.} | |
63 | ||
64 | \docparam{height}{Specifies the height of the image.} | |
65 | ||
66 | \docparam{name}{This refers to an image filename. Its meaning is determined by the {\it type} parameter.} | |
67 | ||
68 | \docparam{stream}{This refers to an input stream. Its meaning is determined by the {\it type} parameter. It is equal to loading from file except that you provide opened stream (file, HTTP or any other custom class).} | |
69 | ||
70 | \docparam{type}{May be one of the following: | |
71 | ||
72 | \twocolwidtha{5cm}% | |
73 | \begin{twocollist} | |
74 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_BMP}}}{Load a Windows bitmap file.} | |
75 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_PNG}}}{Load a PNG bitmap file.} | |
76 | \twocolitem{{\bf \indexit{wxBITMAP\_TYPE\_JPEG}}}{Load a JPEG bitmap file.} | |
77 | \end{twocollist} | |
78 | ||
79 | The validity of these flags depends on the platform and wxWindows configuration. | |
80 | If all possible wxWindows settings are used, the loading a BMP (Windows bitmap) file, | |
81 | a PNG (portable network graphics) file and a JPEG file is supported on all platforms that | |
82 | implement wxImage.} | |
83 | ||
84 | \docparam{mimetype}{MIME type string (for example 'image/jpeg')} | |
85 | ||
86 | Note : you must call wxImage::AddHandler(new wxJPEGHandler) during application | |
87 | initialization in order to work with JPEGs. | |
88 | ||
89 | \wxheading{See also} | |
90 | ||
91 | \helpref{wxImage::LoadFile}{wximageloadfile} | |
92 | ||
93 | \pythonnote{Constructors supported by wxPython are:\par | |
94 | \indented{2cm}{\begin{twocollist} | |
95 | \twocolitem{\bf{wxImage(name, flag)}}{Loads an image from a file} | |
96 | \twocolitem{\bf{wxNullImage()}}{Create a null image (has no size or | |
97 | image data)} | |
98 | \twocolitem{\bf{wxEmptyImage(width, height)}}{Creates an empty image | |
99 | of the given size} | |
100 | \twocolitem{\bf{wxImageFromMime(name, mimetype}}{Creates an image from | |
101 | the given file of the given mimetype} | |
102 | \twocolitem{\bf{wxImageFromBitmap(bitmap)}}{Creates an image from a | |
103 | platform-dependent bitmap} | |
104 | \end{twocollist}} | |
105 | } | |
106 | ||
107 | \membersection{wxImage::\destruct{wxImage}} | |
108 | ||
109 | \func{}{\destruct{wxImage}}{\void} | |
110 | ||
111 | Destructor. | |
112 | ||
113 | \membersection{wxImage::AddHandler}\label{wximageaddhandler} | |
114 | ||
115 | \func{static void}{AddHandler}{\param{wxImageHandler*}{ handler}} | |
116 | ||
117 | Adds a handler to the end of the static list of format handlers. | |
118 | ||
119 | \docparam{handler}{A new image format handler object. There is usually only one instance | |
120 | of a given handler class in an application session.} | |
121 | ||
122 | \wxheading{See also} | |
123 | ||
124 | \helpref{wxImageHandler}{wximagehandler} | |
125 | ||
126 | \pythonnote{In wxPython this static method is named \tt{wxImage_AddHandler}.} | |
127 | \membersection{wxImage::CleanUpHandlers} | |
128 | ||
129 | \func{static void}{CleanUpHandlers}{\void} | |
130 | ||
131 | Deletes all image handlers. | |
132 | ||
133 | This function is called by wxWindows on exit. | |
134 | ||
135 | \membersection{wxImage::ConvertToBitmap}\label{wximageconverttobitmap} | |
136 | ||
137 | \constfunc{wxBitmap}{ConvertToBitmap}{\void} | |
138 | ||
139 | Converts the image to a platform-specific bitmap object. This has to be done | |
140 | to actually display an image as you cannot draw an image directly on a window. | |
141 | The resulting bitmap will use the colour depth of the current system which entails | |
142 | that a (crude) colour reduction has to take place. When in 8-bit mode, this | |
143 | routine will use a color cube created on program start-up to look up colors. | |
144 | Still, the image quality won't be perfect for photo images. | |
145 | ||
146 | \membersection{wxImage::Create}\label{wximagecreate} | |
147 | ||
148 | \func{bool}{Create}{\param{int}{ width}, \param{int}{ height}} | |
149 | ||
150 | Creates a fresh image. | |
151 | ||
152 | \wxheading{Parameters} | |
153 | ||
154 | \docparam{width}{The width of the image in pixels.} | |
155 | ||
156 | \docparam{height}{The height of the image in pixels.} | |
157 | ||
158 | \wxheading{Return value} | |
159 | ||
160 | TRUE if the call succeeded, FALSE otherwise. | |
161 | ||
162 | \membersection{wxImage::Destroy}\label{wximagedestroy} | |
163 | ||
164 | \func{bool}{Destroy}{\void} | |
165 | ||
166 | Destroys the image data. | |
167 | ||
168 | \membersection{wxImage::FindHandler} | |
169 | ||
170 | \func{static wxImageHandler*}{FindHandler}{\param{const wxString\& }{name}} | |
171 | ||
172 | Finds the handler with the given name. | |
173 | ||
174 | \func{static wxImageHandler*}{FindHandler}{\param{const wxString\& }{extension}, \param{long}{ imageType}} | |
175 | ||
176 | Finds the handler associated with the given extension and type. | |
177 | ||
178 | \func{static wxImageHandler*}{FindHandler}{\param{long }{imageType}} | |
179 | ||
180 | Finds the handler associated with the given image type. | |
181 | ||
182 | \func{static wxImageHandler*}{FindHandlerMime}{\param{const wxString\& }{mimetype}} | |
183 | ||
184 | Finds the handler associated with the given MIME type. | |
185 | ||
186 | \docparam{name}{The handler name.} | |
187 | ||
188 | \docparam{extension}{The file extension, such as ``bmp".} | |
189 | ||
190 | \docparam{imageType}{The image type, such as wxBITMAP\_TYPE\_BMP.} | |
191 | ||
192 | \docparam{mimetype}{MIME type.} | |
193 | ||
194 | \wxheading{Return value} | |
195 | ||
196 | A pointer to the handler if found, NULL otherwise. | |
197 | ||
198 | \wxheading{See also} | |
199 | ||
200 | \helpref{wxImageHandler}{wximagehandler} | |
201 | ||
202 | \membersection{wxImage::GetBlue}\label{wximagegetblue} | |
203 | ||
204 | \constfunc{unsigned char}{GetBlue}{\param{int}{ x}, \param{int}{ y}} | |
205 | ||
206 | Returns the blue intensity at the given coordinate. | |
207 | ||
208 | \membersection{wxImage::GetData}\label{wximagegetdata} | |
209 | ||
210 | \constfunc{unsigned char*}{GetData}{\void} | |
211 | ||
212 | Returns the image data as an array. This is most often used when doing | |
213 | direct image manipulation. The return value points to an array of | |
214 | chararcters in RGBGBRGB... format. | |
215 | ||
216 | \membersection{wxImage::GetGreen}\label{wximagegetgreen} | |
217 | ||
218 | \constfunc{unsigned char}{GetGreen}{\param{int}{ x}, \param{int}{ y}} | |
219 | ||
220 | Returns the green intensity at the given coordinate. | |
221 | ||
222 | \membersection{wxImage::GetRed}\label{wximagegetred} | |
223 | ||
224 | \constfunc{unsigned char}{GetRed}{\param{int}{ x}, \param{int}{ y}} | |
225 | ||
226 | Returns the red intensity at the given coordinate. | |
227 | ||
228 | \membersection{wxImage::GetHandlers} | |
229 | ||
230 | \func{static wxList\&}{GetHandlers}{\void} | |
231 | ||
232 | Returns the static list of image format handlers. | |
233 | ||
234 | \wxheading{See also} | |
235 | ||
236 | \helpref{wxImageHandler}{wximagehandler} | |
237 | ||
238 | \membersection{wxImage::GetHeight}\label{wximagegetheight} | |
239 | ||
240 | \constfunc{int}{GetHeight}{\void} | |
241 | ||
242 | Gets the height of the image in pixels. | |
243 | ||
244 | \membersection{wxImage::GetMaskBlue}\label{wximagegetmaskblue} | |
245 | ||
246 | \constfunc{unsigned char}{GetMaskBlue}{\void} | |
247 | ||
248 | Gets the blue value of the mask colour. | |
249 | ||
250 | \membersection{wxImage::GetMaskGreen}\label{wximagegetmaskgreen} | |
251 | ||
252 | \constfunc{unsigned char}{GetMaskGreen}{\void} | |
253 | ||
254 | Gets the green value of the mask colour. | |
255 | ||
256 | \membersection{wxImage::GetMaskRed}\label{wximagegetmaskred} | |
257 | ||
258 | \constfunc{unsigned char}{GetMaskRed}{\void} | |
259 | ||
260 | Gets the red value of the mask colour. | |
261 | ||
262 | \membersection{wxImage::GetWidth}\label{wximagegetwidth} | |
263 | ||
264 | \constfunc{int}{GetWidth}{\void} | |
265 | ||
266 | Gets the width of the image in pixels. | |
267 | ||
268 | \wxheading{See also} | |
269 | ||
270 | \helpref{wxImage::GetHeight}{wximagegetheight} | |
271 | ||
272 | \membersection{wxImage::HasMask}\label{wximagehasmask} | |
273 | ||
274 | \constfunc{bool}{HasMask}{\void} | |
275 | ||
276 | Returns TRUE if there is a mask active, FALSE otherwise. | |
277 | ||
278 | \membersection{wxImage::InitStandardHandlers} | |
279 | ||
280 | \func{static void}{InitStandardHandlers}{\void} | |
281 | ||
282 | Internal use only. Adds standard image format handlers. It only install BMP | |
283 | for the time being, which is use by wxBitmap. | |
284 | ||
285 | This function is called by wxWindows on startup, and shouldn't be called by | |
286 | the user. | |
287 | ||
288 | \wxheading{See also} | |
289 | ||
290 | \helpref{wxImageHandler}{wximagehandler} | |
291 | \helpref{wxInitAllImageHandlers}{wxinitallimagehandlers} | |
292 | ||
293 | \membersection{wxImage::InsertHandler} | |
294 | ||
295 | \func{static void}{InsertHandler}{\param{wxImageHandler*}{ handler}} | |
296 | ||
297 | Adds a handler at the start of the static list of format handlers. | |
298 | ||
299 | \docparam{handler}{A new image format handler object. There is usually only one instance | |
300 | of a given handler class in an application session.} | |
301 | ||
302 | \wxheading{See also} | |
303 | ||
304 | \helpref{wxImageHandler}{wximagehandler} | |
305 | ||
306 | \membersection{wxImage::LoadFile}\label{wximageloadfile} | |
307 | ||
308 | \func{bool}{LoadFile}{\param{const wxString\&}{ name}, \param{long}{ type = wxBITMAP\_TYPE\_ANY}} | |
309 | ||
310 | \func{bool}{LoadFile}{\param{const wxString\&}{ name}, \param{const wxString\&}{ mimetype}} | |
311 | ||
312 | Loads an image from a file. If no handler type is provided, the library will | |
313 | try to use wxBITMAP\_TYPE\_BMP. | |
314 | ||
315 | \func{bool}{LoadFile}{\param{wxInputStream\&}{ stream}, \param{long}{ type}} | |
316 | ||
317 | \func{bool}{LoadFile}{\param{wxInputStream\&}{ stream}, \param{const wxString\&}{ mimetype}} | |
318 | ||
319 | Loads an image from an input stream. | |
320 | ||
321 | \wxheading{Parameters} | |
322 | ||
323 | \docparam{name}{A filename. | |
324 | The meaning of {\it name} is determined by the {\it type} parameter.} | |
325 | ||
326 | \docparam{stream}{An input stream. | |
327 | The meaning of {\it stream} data is determined by the {\it type} parameter.} | |
328 | ||
329 | \docparam{type}{One of the following values: | |
330 | ||
331 | \twocolwidtha{5cm}% | |
332 | \begin{twocollist} | |
333 | \twocolitem{{\bf wxBITMAP\_TYPE\_BMP}}{Load a Windows image file.} | |
334 | \twocolitem{{\bf wxBITMAP\_TYPE\_GIF}}{Load a GIF image file.} | |
335 | \twocolitem{{\bf wxBITMAP\_TYPE\_JPEG}}{Load a JPEG image file.} | |
336 | \twocolitem{{\bf wxBITMAP\_TYPE\_PCX}}{Load a PCX image file.} | |
337 | \twocolitem{{\bf wxBITMAP\_TYPE\_PNG}}{Load a PNG image file.} | |
338 | \twocolitem{{\bf wxBITMAP\_TYPE\_PNM}}{Load a PNM image file.} | |
339 | \end{twocollist} | |
340 | ||
341 | The validity of these flags depends on the platform and wxWindows configuration.} | |
342 | ||
343 | \docparam{mimetype}{MIME type string (for example 'image/jpeg')} | |
344 | ||
345 | \wxheading{Return value} | |
346 | ||
347 | TRUE if the operation succeeded, FALSE otherwise. | |
348 | ||
349 | \wxheading{See also} | |
350 | ||
351 | \helpref{wxImage::SaveFile}{wximagesavefile} | |
352 | ||
353 | \pythonnote{In place of a single overloaded method name, wxPython | |
354 | implements the following methods:\par | |
355 | \indented{2cm}{\begin{twocollist} | |
356 | \twocolitem{\bf{LoadFile(filename, type)}}{Loads an image of the given | |
357 | type from a file} | |
358 | \twocolitem{\bf{LoadMimeFile(filename, mimetype)}}{Loads an image of the given | |
359 | mimetype from a file} | |
360 | \end{twocollist}} | |
361 | } | |
362 | ||
363 | ||
364 | \membersection{wxImage::Ok}\label{wximageok} | |
365 | ||
366 | \constfunc{bool}{Ok}{\void} | |
367 | ||
368 | Returns TRUE if image data is present. | |
369 | ||
370 | \membersection{wxImage::RemoveHandler} | |
371 | ||
372 | \func{static bool}{RemoveHandler}{\param{const wxString\& }{name}} | |
373 | ||
374 | Finds the handler with the given name, and removes it. The handler | |
375 | is not deleted. | |
376 | ||
377 | \docparam{name}{The handler name.} | |
378 | ||
379 | \wxheading{Return value} | |
380 | ||
381 | TRUE if the handler was found and removed, FALSE otherwise. | |
382 | ||
383 | \wxheading{See also} | |
384 | ||
385 | \helpref{wxImageHandler}{wximagehandler} | |
386 | ||
387 | \membersection{wxImage::SaveFile}\label{wximagesavefile} | |
388 | ||
389 | \func{bool}{SaveFile}{\param{const wxString\& }{name}, \param{int}{ type}} | |
390 | ||
391 | \func{bool}{SaveFile}{\param{const wxString\& }{name}, \param{const wxString\&}{ mimetype}} | |
392 | ||
393 | Saves a image in the named file. | |
394 | ||
395 | \func{bool}{SaveFile}{\param{wxOutputStream\& }{stream}, \param{int}{ type}} | |
396 | ||
397 | \func{bool}{SaveFile}{\param{wxOutputStream\& }{stream}, \param{const wxString\&}{ mimetype}} | |
398 | ||
399 | Saves a image in the given stream. | |
400 | ||
401 | \wxheading{Parameters} | |
402 | ||
403 | \docparam{name}{A filename. The meaning of {\it name} is determined by the {\it type} parameter.} | |
404 | ||
405 | \docparam{stream}{An output stream. The meaning of {\it stream} is determined by the {\it type} parameter.} | |
406 | ||
407 | \docparam{type}{Currently two types can be used: | |
408 | ||
409 | \twocolwidtha{5cm}% | |
410 | \begin{twocollist} | |
411 | \twocolitem{{\bf wxBITMAP\_TYPE\_PNG}}{Save a PNG image file.} | |
412 | \twocolitem{{\bf wxBITMAP\_TYPE\_JPEG}}{Save a JPEG image file.} | |
413 | \end{twocollist} | |
414 | ||
415 | The validity of these flags depends on the platform and wxWindows configuration | |
416 | as well as user-added handlers.} | |
417 | ||
418 | \docparam{mimetype}{MIME type.} | |
419 | ||
420 | \wxheading{Return value} | |
421 | ||
422 | TRUE if the operation succeeded, FALSE otherwise. | |
423 | ||
424 | \wxheading{Remarks} | |
425 | ||
426 | Depending on how wxWindows has been configured, not all formats may be available. | |
427 | ||
428 | \wxheading{See also} | |
429 | ||
430 | \helpref{wxImage::LoadFile}{wximageloadfile} | |
431 | ||
432 | \pythonnote{In place of a single overloaded method name, wxPython | |
433 | implements the following methods:\par | |
434 | \indented{2cm}{\begin{twocollist} | |
435 | \twocolitem{\bf{SaveFile(filename, type)}}{Saves the image using the given | |
436 | type to the named file} | |
437 | \twocolitem{\bf{SaveMimeFile(filename, mimetype)}}{Saves the image using the given | |
438 | mimetype to the named file} | |
439 | \end{twocollist}} | |
440 | } | |
441 | ||
442 | \membersection{wxImage::Rescale}\label{wximagerescale} | |
443 | ||
444 | \func{wxImage}{Rescale}{\param{int}{ width}, \param{int}{ height}} | |
445 | ||
446 | Changes the size of the image in-place: after a call to this function, the | |
447 | image will have the given width and height. | |
448 | ||
449 | \wxheading{See also} | |
450 | ||
451 | \helpref{Scale}{wximagescale} | |
452 | ||
453 | \membersection{wxImage::Scale}\label{wximagescale} | |
454 | ||
455 | \constfunc{wxImage}{Scale}{\param{int}{ width}, \param{int}{ height}} | |
456 | ||
457 | Returns a scaled version of the image. This is also useful for | |
458 | scaling bitmaps in general as the only other way to scale bitmaps | |
459 | is to blit a wxMemoryDC into another wxMemoryDC. | |
460 | ||
461 | NB: although Windows can do such scaling itself but in the GTK port, scaling | |
462 | bitmaps is done using this routine internally. | |
463 | ||
464 | Example: | |
465 | ||
466 | \begin{verbatim} | |
467 | // get the bitmap from somewhere | |
468 | wxBitmap bmp = ...; | |
469 | ||
470 | // rescale it to have size of 32*32 | |
471 | if ( bmp.GetWidth() != 32 || bmp.GetHeight() != 32 ) | |
472 | { | |
473 | wxImage image(bmp); | |
474 | bmp = image.Scale(32, 32).ConvertToBitmap(); | |
475 | ||
476 | // another possibility: | |
477 | image.Rescale(32, 32); | |
478 | bmp = image; | |
479 | } | |
480 | ||
481 | \end{verbatim} | |
482 | ||
483 | \wxheading{See also} | |
484 | ||
485 | \helpref{Rescale}{wximagerescale} | |
486 | ||
487 | \membersection{wxImage::GetSubImage}\label{wximagegetsubimage} | |
488 | ||
489 | \constfunc{wxImage}{GetSubImage}{\param{const wxRect&}{rect}} | |
490 | ||
491 | Returns a sub image of the current one as long as the rect belongs entirely to | |
492 | the image. | |
493 | ||
494 | \membersection{wxImage::SetData}\label{wximagesetdata} | |
495 | ||
496 | \func{void}{SetData}{\param{unsigned char*}{data}} | |
497 | ||
498 | Sets the image data without performing checks. The data given must have | |
499 | the size (width*height*3) or results will be unexpected. Don't use this | |
500 | method if you aren't sure you know what you are doing. | |
501 | ||
502 | \membersection{wxImage::SetMask}\label{wximagesetmask} | |
503 | ||
504 | \func{void}{SetMask}{\param{bool}{ hasMask = TRUE}} | |
505 | ||
506 | Specifies whether there is a mask or not. The area of the mask is determined by the current mask colour. | |
507 | ||
508 | \membersection{wxImage::SetMaskColour}\label{wximagesetmaskcolour} | |
509 | ||
510 | \func{void}{SetMaskColour}{\param{unsigned char }{red}, \param{unsigned char }{blue}, \param{unsigned char }{green}} | |
511 | ||
512 | Sets the mask colour for this image (and tells the image to use the mask). | |
513 | ||
514 | \membersection{wxImage::SetRGB}\label{wximagesetrgb} | |
515 | ||
516 | \func{void}{SetRGB}{\param{int }{x}, \param{int }{y}, \param{unsigned char }{red}, \param{unsigned char }{blue}, \param{unsigned char }{green}} | |
517 | ||
518 | Sets the pixel at the given coordinate. This routine performs bounds-checks | |
519 | for the coordinate so it can be considered a safe way to manipulate the | |
520 | data, but in some cases this might be too slow so that the data will have to | |
521 | be set directly. In that case you have to get that data by calling GetData(). | |
522 | ||
523 | \membersection{wxImage::operator $=$} | |
524 | ||
525 | \func{wxImage\& }{operator $=$}{\param{const wxImage\& }{image}} | |
526 | ||
527 | Assignment operator. This operator does not copy any data, but instead | |
528 | passes a pointer to the data in {\it image} and increments a reference | |
529 | counter. It is a fast operation. | |
530 | ||
531 | \wxheading{Parameters} | |
532 | ||
533 | \docparam{image}{Image to assign.} | |
534 | ||
535 | \wxheading{Return value} | |
536 | ||
537 | Returns 'this' object. | |
538 | ||
539 | \membersection{wxImage::operator $==$} | |
540 | ||
541 | \func{bool}{operator $==$}{\param{const wxImage\& }{image}} | |
542 | ||
543 | Equality operator. This operator tests whether the internal data pointers are | |
544 | equal (a fast test). | |
545 | ||
546 | \wxheading{Parameters} | |
547 | ||
548 | \docparam{image}{Image to compare with 'this'} | |
549 | ||
550 | \wxheading{Return value} | |
551 | ||
552 | Returns TRUE if the images were effectively equal, FALSE otherwise. | |
553 | ||
554 | \membersection{wxImage::operator $!=$} | |
555 | ||
556 | \func{bool}{operator $!=$}{\param{const wxImage\& }{image}} | |
557 | ||
558 | Inequality operator. This operator tests whether the internal data pointers are | |
559 | unequal (a fast test). | |
560 | ||
561 | \wxheading{Parameters} | |
562 | ||
563 | \docparam{image}{Image to compare with 'this'} | |
564 | ||
565 | \wxheading{Return value} | |
566 | ||
567 | Returns TRUE if the images were unequal, FALSE otherwise. | |
568 | ||
569 | \section{\class{wxImageHandler}}\label{wximagehandler} | |
570 | ||
571 | This is the base class for implementing image file loading/saving, and image creation from data. | |
572 | It is used within wxImage and is not normally seen by the application. | |
573 | ||
574 | If you wish to extend the capabilities of wxImage, derive a class from wxImageHandler | |
575 | and add the handler using \helpref{wxImage::AddHandler}{wximageaddhandler} in your | |
576 | application initialisation. | |
577 | ||
578 | \wxheading{Note (Legal Issue)} | |
579 | ||
580 | This software is based in part on the work of the Independent JPEG Group. | |
581 | ||
582 | (Applies when wxWindows is linked with JPEG support. wxJPEGHandler uses libjpeg | |
583 | created by IJG.) | |
584 | ||
585 | \wxheading{Derived from} | |
586 | ||
587 | \helpref{wxObject}{wxobject} | |
588 | ||
589 | \wxheading{Include files} | |
590 | ||
591 | <wx/image.h> | |
592 | ||
593 | \wxheading{See also} | |
594 | ||
595 | \helpref{wxImage}{wximage} | |
596 | \helpref{wxInitAllImageHandlers}{wxinitallimagehandlers} | |
597 | ||
598 | \latexignore{\rtfignore{\wxheading{Members}}} | |
599 | ||
600 | \membersection{wxImageHandler::wxImageHandler}\label{wximagehandlerconstr} | |
601 | ||
602 | \func{}{wxImageHandler}{\void} | |
603 | ||
604 | Default constructor. In your own default constructor, initialise the members | |
605 | m\_name, m\_extension and m\_type. | |
606 | ||
607 | \membersection{wxImageHandler::\destruct{wxImageHandler}} | |
608 | ||
609 | \func{}{\destruct{wxImageHandler}}{\void} | |
610 | ||
611 | Destroys the wxImageHandler object. | |
612 | ||
613 | \membersection{wxImageHandler::GetName} | |
614 | ||
615 | \constfunc{wxString}{GetName}{\void} | |
616 | ||
617 | Gets the name of this handler. | |
618 | ||
619 | \membersection{wxImageHandler::GetExtension} | |
620 | ||
621 | \constfunc{wxString}{GetExtension}{\void} | |
622 | ||
623 | Gets the file extension associated with this handler. | |
624 | ||
625 | \membersection{wxImageHandler::GetType} | |
626 | ||
627 | \constfunc{long}{GetType}{\void} | |
628 | ||
629 | Gets the image type associated with this handler. | |
630 | ||
631 | \membersection{wxImageHandler::GetMimeType} | |
632 | ||
633 | \constfunc{wxString}{GetMimeType}{\void} | |
634 | ||
635 | Gets the MIME type associated with this handler. | |
636 | ||
637 | \membersection{wxImageHandler::LoadFile}\label{wximagehandlerloadfile} | |
638 | ||
639 | \func{bool}{LoadFile}{\param{wxImage* }{image}, \param{wxInputStream\&}{ stream}} | |
640 | ||
641 | Loads a image from a stream, putting the resulting data into {\it image}. | |
642 | ||
643 | \wxheading{Parameters} | |
644 | ||
645 | \docparam{image}{The image object which is to be affected by this operation.} | |
646 | ||
647 | \docparam{stream}{Opened input stream. | |
648 | The meaning of {\it stream} is determined by the {\it type} parameter.} | |
649 | ||
650 | \wxheading{Return value} | |
651 | ||
652 | TRUE if the operation succeeded, FALSE otherwise. | |
653 | ||
654 | \wxheading{See also} | |
655 | ||
656 | \helpref{wxImage::LoadFile}{wximageloadfile}\\ | |
657 | \helpref{wxImage::SaveFile}{wximagesavefile}\\ | |
658 | \helpref{wxImageHandler::SaveFile}{wximagehandlersavefile} | |
659 | ||
660 | \membersection{wxImageHandler::SaveFile}\label{wximagehandlersavefile} | |
661 | ||
662 | \func{bool}{SaveFile}{\param{wxImage* }{image}, \param{wxOutputStream\& }{stream}} | |
663 | ||
664 | Saves a image in the output stream. | |
665 | ||
666 | \wxheading{Parameters} | |
667 | ||
668 | \docparam{image}{The image object which is to be affected by this operation.} | |
669 | ||
670 | \docparam{stream}{A stream. The meaning of {\it stream} is determined by the {\it type} parameter.} | |
671 | ||
672 | \wxheading{Return value} | |
673 | ||
674 | TRUE if the operation succeeded, FALSE otherwise. | |
675 | ||
676 | \wxheading{See also} | |
677 | ||
678 | \helpref{wxImage::LoadFile}{wximageloadfile}\\ | |
679 | \helpref{wxImage::SaveFile}{wximagesavefile}\\ | |
680 | \helpref{wxImageHandler::LoadFile}{wximagehandlerloadfile} | |
681 | ||
682 | \membersection{wxImageHandler::SetName} | |
683 | ||
684 | \func{void}{SetName}{\param{const wxString\& }{name}} | |
685 | ||
686 | Sets the handler name. | |
687 | ||
688 | \wxheading{Parameters} | |
689 | ||
690 | \docparam{name}{Handler name.} | |
691 | ||
692 | \membersection{wxImageHandler::SetExtension} | |
693 | ||
694 | \func{void}{SetExtension}{\param{const wxString\& }{extension}} | |
695 | ||
696 | Sets the handler extension. | |
697 | ||
698 | \wxheading{Parameters} | |
699 | ||
700 | \docparam{extension}{Handler extension.} | |
701 | ||
702 | \membersection{wxImageHandler::SetType} | |
703 | ||
704 | \func{void}{SetType}{\param{long }{type}} | |
705 | ||
706 | Sets the handler type. | |
707 | ||
708 | \wxheading{Parameters} | |
709 | ||
710 | \docparam{name}{Handler type.} | |
711 | ||
712 | ||
713 | \membersection{wxImageHandler::SetMimeType} | |
714 | ||
715 | \func{void}{SetMimeType}{\param{const wxString\& }{mimetype}} | |
716 | ||
717 | Sets the handler MIME type. | |
718 | ||
719 | \wxheading{Parameters} | |
720 | ||
721 | \docparam{mimename}{Handler MIME type.} | |
722 |