1 \section{\class{wxImage
}}\label{wximage
}
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.
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
}.
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.
17 \wxheading{Available image handlers
}
19 The following image handlers are available.
{\bf wxBMPHandler
} is always
20 installed by default. To use other image formats, install the appropiate
21 handler with
\helpref{wxImage::AddHandler
}{wximageaddhandler
} or
22 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}.
26 \twocolitem{{\bf \indexit{wxBMPHandler
}}}{Only for loading, always installed.
}
27 \twocolitem{{\bf \indexit{wxPNGHandler
}}}{For loading and saving.
}
28 \twocolitem{{\bf \indexit{wxJPEGHandler
}}}{For loading and saving.
}
29 \twocolitem{{\bf \indexit{wxGIFHandler
}}}{Only for loading, due to legal issues.
}
30 \twocolitem{{\bf \indexit{wxPCXHandler
}}}{For loading and saving (see below).
}
31 \twocolitem{{\bf \indexit{wxPNMHandler
}}}{For loading and saving (see below).
}
34 When saving in PCX format,
{\bf wxPCXHandler
} will count the number of
35 different colours in the image; if there are
256 or less colours, it will
36 save as
8 bit, else it will save as
24 bit.
38 Loading PNMs only works for ASCII or raw RGB images. When saving in
39 PNM format,
{\bf wxPNMHandler
} will always save as raw RGB.
41 \wxheading{Derived from
}
43 \helpref{wxObject
}{wxobject
}
45 \wxheading{Include files
}
51 \helpref{wxBitmap
}{wxbitmap
}
52 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}
54 \latexignore{\rtfignore{\wxheading{Members
}}}
56 \membersection{wxImage::wxImage
}\label{wximageconstr
}
58 \func{}{wxImage
}{\void}
62 \func{}{wxImage
}{\param{const wxImage\&
}{image
}}
66 \func{}{wxImage
}{\param{const wxBitmap\&
}{ bitmap
}}
68 Constructs an image from a platform-dependent bitmap. This preserves
69 mask information so that bitmaps and images can be converted back
70 and forth without loss in that respect.
72 \func{}{wxImage
}{\param{int
}{ width
},
\param{int
}{ height
}}
74 Creates an image with the given width and height.
76 \func{}{wxImage
}{\param{const wxString\&
}{name
},
\param{long
}{ type = wxBITMAP
\_TYPE\_PNG}}
78 \func{}{wxImage
}{\param{const wxString\&
}{name
},
\param{const wxString\&
}{ mimetype
}}
80 Loads an image from a file.
82 \func{}{wxImage
}{\param{wxInputStream\&
}{stream
},
\param{long
}{ type = wxBITMAP
\_TYPE\_PNG}}
84 \func{}{wxImage
}{\param{wxInputStream\&
}{stream
},
\param{const wxString\&
}{ mimetype
}}
86 Loads an image from an input stream.
88 \wxheading{Parameters
}
90 \docparam{width
}{Specifies the width of the image.
}
92 \docparam{height
}{Specifies the height of the image.
}
94 \docparam{name
}{This refers to an image filename. Its meaning is determined by the
{\it type
} parameter.
}
96 \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).
}
98 \docparam{type
}{May be one of the following:
102 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_BMP}}}{Load a Windows bitmap file.
}
103 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_PNG}}}{Load a PNG bitmap file.
}
104 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_JPEG}}}{Load a JPEG bitmap file.
}
105 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_GIF}}}{Load a GIF bitmap file.
}
106 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_PCX}}}{Load a PCX bitmap file.
}
107 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_PNM}}}{Load a PNM bitmap file.
}
110 The validity of these flags depends on the platform and wxWindows configuration.
111 If all possible wxWindows settings are used, the loading a BMP (Windows bitmap) file,
112 a PNG (portable network graphics) file and a JPEG file is supported on all platforms that
115 \docparam{mimetype
}{MIME type string (for example 'image/jpeg')
}
117 Note : you must call wxImage::AddHandler(new wxJPEGHandler) during application
118 initialization in order to work with JPEGs.
122 \helpref{wxImage::LoadFile
}{wximageloadfile
}
124 \pythonnote{Constructors supported by wxPython are:
\par
125 \indented{2cm
}{\begin{twocollist
}
126 \twocolitem{{\bf wxImage(name, flag)
}}{Loads an image from a file
}
127 \twocolitem{{\bf wxNullImage()
}}{Create a null image (has no size or
129 \twocolitem{{\bf wxEmptyImage(width, height)
}}{Creates an empty image
131 \twocolitem{{\bf wxImageFromMime(name, mimetype
}}{Creates an image from
132 the given file of the given mimetype
}
133 \twocolitem{{\bf wxImageFromBitmap(bitmap)
}}{Creates an image from a
134 platform-dependent bitmap
}
138 \membersection{wxImage::
\destruct{wxImage
}}
140 \func{}{\destruct{wxImage
}}{\void}
144 \membersection{wxImage::AddHandler
}\label{wximageaddhandler
}
146 \func{static void
}{AddHandler
}{\param{wxImageHandler*
}{ handler
}}
148 Adds a handler to the end of the static list of format handlers.
150 \docparam{handler
}{A new image format handler object. There is usually only one instance
151 of a given handler class in an application session.
}
155 \helpref{wxImageHandler
}{wximagehandler
}
157 \pythonnote{In wxPython this static method is named
{\tt wxImage_AddHandler
}.
}
158 \membersection{wxImage::CleanUpHandlers
}
160 \func{static void
}{CleanUpHandlers
}{\void}
162 Deletes all image handlers.
164 This function is called by wxWindows on exit.
166 \membersection{wxImage::ConvertToBitmap
}\label{wximageconverttobitmap
}
168 \constfunc{wxBitmap
}{ConvertToBitmap
}{\void}
170 Converts the image to a platform-specific bitmap object. This has to be done
171 to actually display an image as you cannot draw an image directly on a window.
172 The resulting bitmap will use the colour depth of the current system which entails
173 that a colour reduction has to take place.
175 When in
8-bit mode (PseudoColour mode), the GTK port will use a
color cube created
176 on program start-up to look up colors. This ensures a very fast conversion, but
177 the image quality won't be perfect (and could be better for photo images using more
178 sophisticated dithering algorithms).
180 \membersection{wxImage::Create
}\label{wximagecreate
}
182 \func{bool
}{Create
}{\param{int
}{ width
},
\param{int
}{ height
}}
184 Creates a fresh image.
186 \wxheading{Parameters
}
188 \docparam{width
}{The width of the image in pixels.
}
190 \docparam{height
}{The height of the image in pixels.
}
192 \wxheading{Return value
}
194 TRUE if the call succeeded, FALSE otherwise.
196 \membersection{wxImage::Destroy
}\label{wximagedestroy
}
198 \func{bool
}{Destroy
}{\void}
200 Destroys the image data.
202 \membersection{wxImage::FindHandler
}
204 \func{static wxImageHandler*
}{FindHandler
}{\param{const wxString\&
}{name
}}
206 Finds the handler with the given name.
208 \func{static wxImageHandler*
}{FindHandler
}{\param{const wxString\&
}{extension
},
\param{long
}{ imageType
}}
210 Finds the handler associated with the given extension and type.
212 \func{static wxImageHandler*
}{FindHandler
}{\param{long
}{imageType
}}
214 Finds the handler associated with the given image type.
216 \func{static wxImageHandler*
}{FindHandlerMime
}{\param{const wxString\&
}{mimetype
}}
218 Finds the handler associated with the given MIME type.
220 \docparam{name
}{The handler name.
}
222 \docparam{extension
}{The file extension, such as ``bmp".
}
224 \docparam{imageType
}{The image type, such as wxBITMAP
\_TYPE\_BMP.
}
226 \docparam{mimetype
}{MIME type.
}
228 \wxheading{Return value
}
230 A pointer to the handler if found, NULL otherwise.
234 \helpref{wxImageHandler
}{wximagehandler
}
236 \membersection{wxImage::GetBlue
}\label{wximagegetblue
}
238 \constfunc{unsigned char
}{GetBlue
}{\param{int
}{ x
},
\param{int
}{ y
}}
240 Returns the blue intensity at the given coordinate.
242 \membersection{wxImage::GetData
}\label{wximagegetdata
}
244 \constfunc{unsigned char*
}{GetData
}{\void}
246 Returns the image data as an array. This is most often used when doing
247 direct image manipulation. The return value points to an array of
248 chararcters in RGBGBRGB... format.
250 \membersection{wxImage::GetGreen
}\label{wximagegetgreen
}
252 \constfunc{unsigned char
}{GetGreen
}{\param{int
}{ x
},
\param{int
}{ y
}}
254 Returns the green intensity at the given coordinate.
256 \membersection{wxImage::GetRed
}\label{wximagegetred
}
258 \constfunc{unsigned char
}{GetRed
}{\param{int
}{ x
},
\param{int
}{ y
}}
260 Returns the red intensity at the given coordinate.
262 \membersection{wxImage::GetHandlers
}
264 \func{static wxList\&
}{GetHandlers
}{\void}
266 Returns the static list of image format handlers.
270 \helpref{wxImageHandler
}{wximagehandler
}
272 \membersection{wxImage::GetHeight
}\label{wximagegetheight
}
274 \constfunc{int
}{GetHeight
}{\void}
276 Gets the height of the image in pixels.
278 \membersection{wxImage::GetMaskBlue
}\label{wximagegetmaskblue
}
280 \constfunc{unsigned char
}{GetMaskBlue
}{\void}
282 Gets the blue value of the mask colour.
284 \membersection{wxImage::GetMaskGreen
}\label{wximagegetmaskgreen
}
286 \constfunc{unsigned char
}{GetMaskGreen
}{\void}
288 Gets the green value of the mask colour.
290 \membersection{wxImage::GetMaskRed
}\label{wximagegetmaskred
}
292 \constfunc{unsigned char
}{GetMaskRed
}{\void}
294 Gets the red value of the mask colour.
296 \membersection{wxImage::GetSubImage
}\label{wximagegetsubimage
}
298 \constfunc{wxImage
}{GetSubImage
}{\param{const wxRect\&
}{ rect
}}
300 Returns a sub image of the current one as long as the rect belongs entirely to
303 \membersection{wxImage::GetWidth
}\label{wximagegetwidth
}
305 \constfunc{int
}{GetWidth
}{\void}
307 Gets the width of the image in pixels.
311 \helpref{wxImage::GetHeight
}{wximagegetheight
}
313 \membersection{wxImage::HasMask
}\label{wximagehasmask
}
315 \constfunc{bool
}{HasMask
}{\void}
317 Returns TRUE if there is a mask active, FALSE otherwise.
319 \membersection{wxImage::InitStandardHandlers
}
321 \func{static void
}{InitStandardHandlers
}{\void}
323 Internal use only. Adds standard image format handlers. It only install BMP
324 for the time being, which is use by wxBitmap.
326 This function is called by wxWindows on startup, and shouldn't be called by
331 \helpref{wxImageHandler
}{wximagehandler
}
332 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}
334 \membersection{wxImage::InsertHandler
}
336 \func{static void
}{InsertHandler
}{\param{wxImageHandler*
}{ handler
}}
338 Adds a handler at the start of the static list of format handlers.
340 \docparam{handler
}{A new image format handler object. There is usually only one instance
341 of a given handler class in an application session.
}
345 \helpref{wxImageHandler
}{wximagehandler
}
347 \membersection{wxImage::LoadFile
}\label{wximageloadfile
}
349 \func{bool
}{LoadFile
}{\param{const wxString\&
}{ name
},
\param{long
}{ type = wxBITMAP
\_TYPE\_ANY}}
351 \func{bool
}{LoadFile
}{\param{const wxString\&
}{ name
},
\param{const wxString\&
}{ mimetype
}}
353 Loads an image from a file. If no handler type is provided, the library will
354 try to use wxBITMAP
\_TYPE\_BMP.
356 \func{bool
}{LoadFile
}{\param{wxInputStream\&
}{ stream
},
\param{long
}{ type
}}
358 \func{bool
}{LoadFile
}{\param{wxInputStream\&
}{ stream
},
\param{const wxString\&
}{ mimetype
}}
360 Loads an image from an input stream.
362 \wxheading{Parameters
}
364 \docparam{name
}{A filename.
365 The meaning of
{\it name
} is determined by the
{\it type
} parameter.
}
367 \docparam{stream
}{An input stream.
368 The meaning of
{\it stream
} data is determined by the
{\it type
} parameter.
}
370 \docparam{type
}{One of the following values:
374 \twocolitem{{\bf wxBITMAP
\_TYPE\_BMP}}{Load a Windows image file.
}
375 \twocolitem{{\bf wxBITMAP
\_TYPE\_GIF}}{Load a GIF image file.
}
376 \twocolitem{{\bf wxBITMAP
\_TYPE\_TIF}}{Load a TIFF image file.
}
377 \twocolitem{{\bf wxBITMAP
\_TYPE\_JPEG}}{Load a JPEG image file.
}
378 \twocolitem{{\bf wxBITMAP
\_TYPE\_PCX}}{Load a PCX image file.
}
379 \twocolitem{{\bf wxBITMAP
\_TYPE\_PNG}}{Load a PNG image file.
}
380 \twocolitem{{\bf wxBITMAP
\_TYPE\_PNM}}{Load a PNM image file.
}
383 The validity of these flags depends on the platform and wxWindows configuration.
}
385 \docparam{mimetype
}{MIME type string (for example 'image/jpeg')
}
387 \wxheading{Return value
}
389 TRUE if the operation succeeded, FALSE otherwise.
393 \helpref{wxImage::SaveFile
}{wximagesavefile
}
395 \pythonnote{In place of a single overloaded method name, wxPython
396 implements the following methods:
\par
397 \indented{2cm
}{\begin{twocollist
}
398 \twocolitem{{\bf LoadFile(filename, type)
}}{Loads an image of the given
400 \twocolitem{{\bf LoadMimeFile(filename, mimetype)
}}{Loads an image of the given
401 mimetype from a file
}
406 \membersection{wxImage::Ok
}\label{wximageok
}
408 \constfunc{bool
}{Ok
}{\void}
410 Returns TRUE if image data is present.
412 \membersection{wxImage::RemoveHandler
}
414 \func{static bool
}{RemoveHandler
}{\param{const wxString\&
}{name
}}
416 Finds the handler with the given name, and removes it. The handler
419 \docparam{name
}{The handler name.
}
421 \wxheading{Return value
}
423 TRUE if the handler was found and removed, FALSE otherwise.
427 \helpref{wxImageHandler
}{wximagehandler
}
429 \membersection{wxImage::SaveFile
}\label{wximagesavefile
}
431 \func{bool
}{SaveFile
}{\param{const wxString\&
}{name
},
\param{int
}{ type
}}
433 \func{bool
}{SaveFile
}{\param{const wxString\&
}{name
},
\param{const wxString\&
}{ mimetype
}}
435 Saves a image in the named file.
437 \func{bool
}{SaveFile
}{\param{wxOutputStream\&
}{stream
},
\param{int
}{ type
}}
439 \func{bool
}{SaveFile
}{\param{wxOutputStream\&
}{stream
},
\param{const wxString\&
}{ mimetype
}}
441 Saves a image in the given stream.
443 \wxheading{Parameters
}
445 \docparam{name
}{A filename. The meaning of
{\it name
} is determined by the
{\it type
} parameter.
}
447 \docparam{stream
}{An output stream. The meaning of
{\it stream
} is determined by the
{\it type
} parameter.
}
449 \docparam{type
}{Currently three types can be used:
453 \twocolitem{{\bf wxBITMAP
\_TYPE\_PNG}}{Save a PNG image file.
}
454 \twocolitem{{\bf wxBITMAP
\_TYPE\_JPEG}}{Save a JPEG image file.
}
455 \twocolitem{{\bf wxBITMAP
\_TYPE\_PCX}}{Save a PCX image file.
}
458 The validity of these flags depends on the platform and wxWindows configuration
459 as well as user-added handlers.
}
461 \docparam{mimetype
}{MIME type.
}
463 \wxheading{Return value
}
465 TRUE if the operation succeeded, FALSE otherwise.
469 Depending on how wxWindows has been configured, not all formats may be available.
473 \helpref{wxImage::LoadFile
}{wximageloadfile
}
475 \pythonnote{In place of a single overloaded method name, wxPython
476 implements the following methods:
\par
477 \indented{2cm
}{\begin{twocollist
}
478 \twocolitem{{\bf SaveFile(filename, type)
}}{Saves the image using the given
479 type to the named file
}
480 \twocolitem{{\bf SaveMimeFile(filename, mimetype)
}}{Saves the image using the given
481 mimetype to the named file
}
485 \membersection{wxImage::Replace
}\label{wximagereplace
}
487 \func{void
}{Replace
}{\param{unsigned char
}{ r1
},
\param{unsigned char
}{ g1
},
\param{unsigned char
}{ b1
},
488 \param{unsigned char
}{ r2
},
\param{unsigned char
}{ g2
},
\param{unsigned char
}{ b2
}}
490 Replaces the colour specified by
{\it r1,g1,b1
} by the colour
{\it r2,g2,b2
}.
492 \membersection{wxImage::Rescale
}\label{wximagerescale
}
494 \func{wxImage \&
}{Rescale
}{\param{int
}{ width
},
\param{int
}{ height
}}
496 Changes the size of the image in-place: after a call to this function, the
497 image will have the given width and height.
499 Returns the (modified) image itself.
503 \helpref{Scale
}{wximagescale
}
505 \membersection{wxImage::Scale
}\label{wximagescale
}
507 \constfunc{wxImage
}{Scale
}{\param{int
}{ width
},
\param{int
}{ height
}}
509 Returns a scaled version of the image. This is also useful for
510 scaling bitmaps in general as the only other way to scale bitmaps
511 is to blit a wxMemoryDC into another wxMemoryDC.
513 It may be mentioned that the GTK port uses this function internally
514 to scale bitmaps when using mapping mode in wxDC.
519 // get the bitmap from somewhere
522 // rescale it to have size of
32*
32
523 if ( bmp.GetWidth() !=
32 || bmp.GetHeight() !=
32 )
526 bmp = image.Scale(
32,
32).ConvertToBitmap();
528 // another possibility:
529 image.Rescale(
32,
32);
537 \helpref{Rescale
}{wximagerescale
}
539 \membersection{wxImage::SetData
}\label{wximagesetdata
}
541 \func{void
}{SetData
}{\param{unsigned char*
}{data
}}
543 Sets the image data without performing checks. The data given must have
544 the size (width*height*
3) or results will be unexpected. Don't use this
545 method if you aren't sure you know what you are doing.
547 \membersection{wxImage::SetMask
}\label{wximagesetmask
}
549 \func{void
}{SetMask
}{\param{bool
}{ hasMask = TRUE
}}
551 Specifies whether there is a mask or not. The area of the mask is determined by the current mask colour.
553 \membersection{wxImage::SetMaskColour
}\label{wximagesetmaskcolour
}
555 \func{void
}{SetMaskColour
}{\param{unsigned char
}{red
},
\param{unsigned char
}{blue
},
\param{unsigned char
}{green
}}
557 Sets the mask colour for this image (and tells the image to use the mask).
559 \membersection{wxImage::SetRGB
}\label{wximagesetrgb
}
561 \func{void
}{SetRGB
}{\param{int
}{x
},
\param{int
}{y
},
\param{unsigned char
}{red
},
\param{unsigned char
}{blue
},
\param{unsigned char
}{green
}}
563 Sets the pixel at the given coordinate. This routine performs bounds-checks
564 for the coordinate so it can be considered a safe way to manipulate the
565 data, but in some cases this might be too slow so that the data will have to
566 be set directly. In that case you will have to get access to the image data
567 using the
\helpref{GetData
}{wximagegetdata
} method.
569 \membersection{wxImage::operator $=$
}
571 \func{wxImage\&
}{operator $=$
}{\param{const wxImage\&
}{image
}}
573 Assignment operator. This operator does not copy any data, but instead
574 passes a pointer to the data in
{\it image
} and increments a reference
575 counter. It is a fast operation.
577 \wxheading{Parameters
}
579 \docparam{image
}{Image to assign.
}
581 \wxheading{Return value
}
583 Returns 'this' object.
585 \membersection{wxImage::operator $==$
}
587 \func{bool
}{operator $==$
}{\param{const wxImage\&
}{image
}}
589 Equality operator. This operator tests whether the internal data pointers are
592 \wxheading{Parameters
}
594 \docparam{image
}{Image to compare with 'this'
}
596 \wxheading{Return value
}
598 Returns TRUE if the images were effectively equal, FALSE otherwise.
600 \membersection{wxImage::operator $!=$
}
602 \func{bool
}{operator $!=$
}{\param{const wxImage\&
}{image
}}
604 Inequality operator. This operator tests whether the internal data pointers are
605 unequal (a fast test).
607 \wxheading{Parameters
}
609 \docparam{image
}{Image to compare with 'this'
}
611 \wxheading{Return value
}
613 Returns TRUE if the images were unequal, FALSE otherwise.
615 \section{\class{wxImageHandler
}}\label{wximagehandler
}
617 This is the base class for implementing image file loading/saving, and image creation from data.
618 It is used within wxImage and is not normally seen by the application.
620 If you wish to extend the capabilities of wxImage, derive a class from wxImageHandler
621 and add the handler using
\helpref{wxImage::AddHandler
}{wximageaddhandler
} in your
622 application initialisation.
624 \wxheading{Note (Legal Issue)
}
626 This software is based in part on the work of the Independent JPEG Group.
628 (Applies when wxWindows is linked with JPEG support. wxJPEGHandler uses libjpeg
631 \wxheading{Derived from
}
633 \helpref{wxObject
}{wxobject
}
635 \wxheading{Include files
}
641 \helpref{wxImage
}{wximage
}
642 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}
644 \latexignore{\rtfignore{\wxheading{Members
}}}
646 \membersection{wxImageHandler::wxImageHandler
}\label{wximagehandlerconstr
}
648 \func{}{wxImageHandler
}{\void}
650 Default constructor. In your own default constructor, initialise the members
651 m
\_name, m
\_extension and m
\_type.
653 \membersection{wxImageHandler::
\destruct{wxImageHandler
}}
655 \func{}{\destruct{wxImageHandler
}}{\void}
657 Destroys the wxImageHandler object.
659 \membersection{wxImageHandler::GetName
}
661 \constfunc{wxString
}{GetName
}{\void}
663 Gets the name of this handler.
665 \membersection{wxImageHandler::GetExtension
}
667 \constfunc{wxString
}{GetExtension
}{\void}
669 Gets the file extension associated with this handler.
671 \membersection{wxImageHandler::GetImageCount
}\label{wximagehandlergetimagecount
}
673 \func{int
}{GetImageCount
}{\param{wxInputStream\&
}{ stream
}}
675 If the image file contains more than one image and the image handler is capable
676 of retrieving these individually, this function will return the number of
679 \docparam{stream
}{Opened input stream for reading image file.
}
681 \wxheading{Return value
}
683 Number of available images. For most image handles, this defaults to
1.
685 \membersection{wxImageHandler::GetType
}
687 \constfunc{long
}{GetType
}{\void}
689 Gets the image type associated with this handler.
691 \membersection{wxImageHandler::GetMimeType
}
693 \constfunc{wxString
}{GetMimeType
}{\void}
695 Gets the MIME type associated with this handler.
697 \membersection{wxImageHandler::LoadFile
}\label{wximagehandlerloadfile
}
699 \func{bool
}{LoadFile
}{\param{wxImage*
}{image
},
\param{wxInputStream\&
}{ stream
},
\param{bool
}{ verbose=TRUE
},
\param{int
}{ index=
0}}
701 Loads a image from a stream, putting the resulting data into
{\it image
}. If the image file contains
702 more than one image and the image handler is capable of retrieving these individually,
{\it index
}
703 indicates which image to read from the stream.
705 \wxheading{Parameters
}
707 \docparam{image
}{The image object which is to be affected by this operation.
}
709 \docparam{stream
}{Opened input stream for reading images.
}
711 \docparam{verbose
}{If set to TRUE, errors reported by the image handler will produce wxLogMessages.
}
713 \docparam{index
}{The index of the image in the file (starting from zero).
}
715 \wxheading{Return value
}
717 TRUE if the operation succeeded, FALSE otherwise.
721 \helpref{wxImage::LoadFile
}{wximageloadfile
}\\
722 \helpref{wxImage::SaveFile
}{wximagesavefile
}\\
723 \helpref{wxImageHandler::SaveFile
}{wximagehandlersavefile
}
725 \membersection{wxImageHandler::SaveFile
}\label{wximagehandlersavefile
}
727 \func{bool
}{SaveFile
}{\param{wxImage*
}{image
},
\param{wxOutputStream\&
}{stream
}}
729 Saves a image in the output stream.
731 \wxheading{Parameters
}
733 \docparam{image
}{The image object which is to be affected by this operation.
}
735 \docparam{stream
}{An opened stream for writing images.
}
737 \wxheading{Return value
}
739 TRUE if the operation succeeded, FALSE otherwise.
743 \helpref{wxImage::LoadFile
}{wximageloadfile
}\\
744 \helpref{wxImage::SaveFile
}{wximagesavefile
}\\
745 \helpref{wxImageHandler::LoadFile
}{wximagehandlerloadfile
}
747 \membersection{wxImageHandler::SetName
}
749 \func{void
}{SetName
}{\param{const wxString\&
}{name
}}
751 Sets the handler name.
753 \wxheading{Parameters
}
755 \docparam{name
}{Handler name.
}
757 \membersection{wxImageHandler::SetExtension
}
759 \func{void
}{SetExtension
}{\param{const wxString\&
}{extension
}}
761 Sets the handler extension.
763 \wxheading{Parameters
}
765 \docparam{extension
}{Handler extension.
}
767 \membersection{wxImageHandler::SetType
}
769 \func{void
}{SetType
}{\param{long
}{type
}}
771 Sets the handler type.
773 \wxheading{Parameters
}
775 \docparam{name
}{Handler type.
}
778 \membersection{wxImageHandler::SetMimeType
}
780 \func{void
}{SetMimeType
}{\param{const wxString\&
}{mimetype
}}
782 Sets the handler MIME type.
784 \wxheading{Parameters
}
786 \docparam{mimename
}{Handler MIME type.
}