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