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\_ANY}}
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\_ANY}}
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.
}
108 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_ANY}}}{Will try to autodetect the format.
}
111 The validity of these flags depends on the platform and wxWindows configuration.
112 If all possible wxWindows settings are used, the loading a BMP (Windows bitmap) file,
113 a PNG (portable network graphics) file and a JPEG file is supported on all platforms that
116 \docparam{mimetype
}{MIME type string (for example 'image/jpeg')
}
118 Note : you must call wxImage::AddHandler(new wxJPEGHandler) during application
119 initialization in order to work with JPEGs.
123 \helpref{wxImage::LoadFile
}{wximageloadfile
}
125 \pythonnote{Constructors supported by wxPython are:
\par
126 \indented{2cm
}{\begin{twocollist
}
127 \twocolitem{{\bf wxImage(name, flag)
}}{Loads an image from a file
}
128 \twocolitem{{\bf wxNullImage()
}}{Create a null image (has no size or
130 \twocolitem{{\bf wxEmptyImage(width, height)
}}{Creates an empty image
132 \twocolitem{{\bf wxImageFromMime(name, mimetype
}}{Creates an image from
133 the given file of the given mimetype
}
134 \twocolitem{{\bf wxImageFromBitmap(bitmap)
}}{Creates an image from a
135 platform-dependent bitmap
}
139 \membersection{wxImage::
\destruct{wxImage
}}
141 \func{}{\destruct{wxImage
}}{\void}
145 \membersection{wxImage::AddHandler
}\label{wximageaddhandler
}
147 \func{static void
}{AddHandler
}{\param{wxImageHandler*
}{ handler
}}
149 Adds a handler to the end of the static list of format handlers.
151 \docparam{handler
}{A new image format handler object. There is usually only one instance
152 of a given handler class in an application session.
}
156 \helpref{wxImageHandler
}{wximagehandler
}
158 \pythonnote{In wxPython this static method is named
{\tt wxImage_AddHandler
}.
}
159 \membersection{wxImage::CleanUpHandlers
}
161 \func{static void
}{CleanUpHandlers
}{\void}
163 Deletes all image handlers.
165 This function is called by wxWindows on exit.
167 \membersection{wxImage::ConvertToBitmap
}\label{wximageconverttobitmap
}
169 \constfunc{wxBitmap
}{ConvertToBitmap
}{\void}
171 Converts the image to a platform-specific bitmap object. This has to be done
172 to actually display an image as you cannot draw an image directly on a window.
173 The resulting bitmap will use the colour depth of the current system which entails
174 that a colour reduction has to take place.
176 When in
8-bit mode (PseudoColour mode), the GTK port will use a
color cube created
177 on program start-up to look up colors. This ensures a very fast conversion, but
178 the image quality won't be perfect (and could be better for photo images using more
179 sophisticated dithering algorithms).
181 \membersection{wxImage::Create
}\label{wximagecreate
}
183 \func{bool
}{Create
}{\param{int
}{ width
},
\param{int
}{ height
}}
185 Creates a fresh image.
187 \wxheading{Parameters
}
189 \docparam{width
}{The width of the image in pixels.
}
191 \docparam{height
}{The height of the image in pixels.
}
193 \wxheading{Return value
}
195 TRUE if the call succeeded, FALSE otherwise.
197 \membersection{wxImage::Destroy
}\label{wximagedestroy
}
199 \func{bool
}{Destroy
}{\void}
201 Destroys the image data.
203 \membersection{wxImage::FindHandler
}
205 \func{static wxImageHandler*
}{FindHandler
}{\param{const wxString\&
}{name
}}
207 Finds the handler with the given name.
209 \func{static wxImageHandler*
}{FindHandler
}{\param{const wxString\&
}{extension
},
\param{long
}{ imageType
}}
211 Finds the handler associated with the given extension and type.
213 \func{static wxImageHandler*
}{FindHandler
}{\param{long
}{imageType
}}
215 Finds the handler associated with the given image type.
217 \func{static wxImageHandler*
}{FindHandlerMime
}{\param{const wxString\&
}{mimetype
}}
219 Finds the handler associated with the given MIME type.
221 \docparam{name
}{The handler name.
}
223 \docparam{extension
}{The file extension, such as ``bmp".
}
225 \docparam{imageType
}{The image type, such as wxBITMAP
\_TYPE\_BMP.
}
227 \docparam{mimetype
}{MIME type.
}
229 \wxheading{Return value
}
231 A pointer to the handler if found, NULL otherwise.
235 \helpref{wxImageHandler
}{wximagehandler
}
237 \membersection{wxImage::GetBlue
}\label{wximagegetblue
}
239 \constfunc{unsigned char
}{GetBlue
}{\param{int
}{ x
},
\param{int
}{ y
}}
241 Returns the blue intensity at the given coordinate.
243 \membersection{wxImage::GetData
}\label{wximagegetdata
}
245 \constfunc{unsigned char*
}{GetData
}{\void}
247 Returns the image data as an array. This is most often used when doing
248 direct image manipulation. The return value points to an array of
249 chararcters in RGBGBRGB... format.
251 \membersection{wxImage::GetGreen
}\label{wximagegetgreen
}
253 \constfunc{unsigned char
}{GetGreen
}{\param{int
}{ x
},
\param{int
}{ y
}}
255 Returns the green intensity at the given coordinate.
257 \membersection{wxImage::GetRed
}\label{wximagegetred
}
259 \constfunc{unsigned char
}{GetRed
}{\param{int
}{ x
},
\param{int
}{ y
}}
261 Returns the red intensity at the given coordinate.
263 \membersection{wxImage::GetHandlers
}
265 \func{static wxList\&
}{GetHandlers
}{\void}
267 Returns the static list of image format handlers.
271 \helpref{wxImageHandler
}{wximagehandler
}
273 \membersection{wxImage::GetHeight
}\label{wximagegetheight
}
275 \constfunc{int
}{GetHeight
}{\void}
277 Gets the height of the image in pixels.
279 \membersection{wxImage::GetMaskBlue
}\label{wximagegetmaskblue
}
281 \constfunc{unsigned char
}{GetMaskBlue
}{\void}
283 Gets the blue value of the mask colour.
285 \membersection{wxImage::GetMaskGreen
}\label{wximagegetmaskgreen
}
287 \constfunc{unsigned char
}{GetMaskGreen
}{\void}
289 Gets the green value of the mask colour.
291 \membersection{wxImage::GetMaskRed
}\label{wximagegetmaskred
}
293 \constfunc{unsigned char
}{GetMaskRed
}{\void}
295 Gets the red value of the mask colour.
297 \membersection{wxImage::GetSubImage
}\label{wximagegetsubimage
}
299 \constfunc{wxImage
}{GetSubImage
}{\param{const wxRect\&
}{ rect
}}
301 Returns a sub image of the current one as long as the rect belongs entirely to
304 \membersection{wxImage::GetWidth
}\label{wximagegetwidth
}
306 \constfunc{int
}{GetWidth
}{\void}
308 Gets the width of the image in pixels.
312 \helpref{wxImage::GetHeight
}{wximagegetheight
}
314 \membersection{wxImage::HasMask
}\label{wximagehasmask
}
316 \constfunc{bool
}{HasMask
}{\void}
318 Returns TRUE if there is a mask active, FALSE otherwise.
320 \membersection{wxImage::InitStandardHandlers
}
322 \func{static void
}{InitStandardHandlers
}{\void}
324 Internal use only. Adds standard image format handlers. It only install BMP
325 for the time being, which is use by wxBitmap.
327 This function is called by wxWindows on startup, and shouldn't be called by
332 \helpref{wxImageHandler
}{wximagehandler
}
333 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}
335 \membersection{wxImage::InsertHandler
}
337 \func{static void
}{InsertHandler
}{\param{wxImageHandler*
}{ handler
}}
339 Adds a handler at the start of the static list of format handlers.
341 \docparam{handler
}{A new image format handler object. There is usually only one instance
342 of a given handler class in an application session.
}
346 \helpref{wxImageHandler
}{wximagehandler
}
348 \membersection{wxImage::LoadFile
}\label{wximageloadfile
}
350 \func{bool
}{LoadFile
}{\param{const wxString\&
}{ name
},
\param{long
}{ type = wxBITMAP
\_TYPE\_ANY}}
352 \func{bool
}{LoadFile
}{\param{const wxString\&
}{ name
},
\param{const wxString\&
}{ mimetype
}}
354 Loads an image from a file. If no handler type is provided, the library will
355 try to use wxBITMAP
\_TYPE\_BMP.
357 \func{bool
}{LoadFile
}{\param{wxInputStream\&
}{ stream
},
\param{long
}{ type
}}
359 \func{bool
}{LoadFile
}{\param{wxInputStream\&
}{ stream
},
\param{const wxString\&
}{ mimetype
}}
361 Loads an image from an input stream.
363 \wxheading{Parameters
}
365 \docparam{name
}{A filename.
366 The meaning of
{\it name
} is determined by the
{\it type
} parameter.
}
368 \docparam{stream
}{An input stream.
369 The meaning of
{\it stream
} data is determined by the
{\it type
} parameter.
}
371 \docparam{type
}{One of the following values:
375 \twocolitem{{\bf wxBITMAP
\_TYPE\_BMP}}{Load a Windows image file.
}
376 \twocolitem{{\bf wxBITMAP
\_TYPE\_GIF}}{Load a GIF image file.
}
377 \twocolitem{{\bf wxBITMAP
\_TYPE\_TIF}}{Load a TIFF image file.
}
378 \twocolitem{{\bf wxBITMAP
\_TYPE\_JPEG}}{Load a JPEG image file.
}
379 \twocolitem{{\bf wxBITMAP
\_TYPE\_PCX}}{Load a PCX image file.
}
380 \twocolitem{{\bf wxBITMAP
\_TYPE\_PNG}}{Load a PNG image file.
}
381 \twocolitem{{\bf wxBITMAP
\_TYPE\_PNM}}{Load a PNM image file.
}
384 The validity of these flags depends on the platform and wxWindows configuration.
}
386 \docparam{mimetype
}{MIME type string (for example 'image/jpeg')
}
388 \wxheading{Return value
}
390 TRUE if the operation succeeded, FALSE otherwise.
394 \helpref{wxImage::SaveFile
}{wximagesavefile
}
396 \pythonnote{In place of a single overloaded method name, wxPython
397 implements the following methods:
\par
398 \indented{2cm
}{\begin{twocollist
}
399 \twocolitem{{\bf LoadFile(filename, type)
}}{Loads an image of the given
401 \twocolitem{{\bf LoadMimeFile(filename, mimetype)
}}{Loads an image of the given
402 mimetype from a file
}
407 \membersection{wxImage::Ok
}\label{wximageok
}
409 \constfunc{bool
}{Ok
}{\void}
411 Returns TRUE if image data is present.
413 \membersection{wxImage::RemoveHandler
}
415 \func{static bool
}{RemoveHandler
}{\param{const wxString\&
}{name
}}
417 Finds the handler with the given name, and removes it. The handler
420 \docparam{name
}{The handler name.
}
422 \wxheading{Return value
}
424 TRUE if the handler was found and removed, FALSE otherwise.
428 \helpref{wxImageHandler
}{wximagehandler
}
430 \membersection{wxImage::SaveFile
}\label{wximagesavefile
}
432 \func{bool
}{SaveFile
}{\param{const wxString\&
}{name
},
\param{int
}{ type
}}
434 \func{bool
}{SaveFile
}{\param{const wxString\&
}{name
},
\param{const wxString\&
}{ mimetype
}}
436 Saves a image in the named file.
438 \func{bool
}{SaveFile
}{\param{wxOutputStream\&
}{stream
},
\param{int
}{ type
}}
440 \func{bool
}{SaveFile
}{\param{wxOutputStream\&
}{stream
},
\param{const wxString\&
}{ mimetype
}}
442 Saves a image in the given stream.
444 \wxheading{Parameters
}
446 \docparam{name
}{A filename. The meaning of
{\it name
} is determined by the
{\it type
} parameter.
}
448 \docparam{stream
}{An output stream. The meaning of
{\it stream
} is determined by the
{\it type
} parameter.
}
450 \docparam{type
}{Currently three types can be used:
454 \twocolitem{{\bf wxBITMAP
\_TYPE\_PNG}}{Save a PNG image file.
}
455 \twocolitem{{\bf wxBITMAP
\_TYPE\_JPEG}}{Save a JPEG image file.
}
456 \twocolitem{{\bf wxBITMAP
\_TYPE\_PCX}}{Save a PCX image file.
}
459 The validity of these flags depends on the platform and wxWindows configuration
460 as well as user-added handlers.
}
462 \docparam{mimetype
}{MIME type.
}
464 \wxheading{Return value
}
466 TRUE if the operation succeeded, FALSE otherwise.
470 Depending on how wxWindows has been configured, not all formats may be available.
474 \helpref{wxImage::LoadFile
}{wximageloadfile
}
476 \pythonnote{In place of a single overloaded method name, wxPython
477 implements the following methods:
\par
478 \indented{2cm
}{\begin{twocollist
}
479 \twocolitem{{\bf SaveFile(filename, type)
}}{Saves the image using the given
480 type to the named file
}
481 \twocolitem{{\bf SaveMimeFile(filename, mimetype)
}}{Saves the image using the given
482 mimetype to the named file
}
486 \membersection{wxImage::Replace
}\label{wximagereplace
}
488 \func{void
}{Replace
}{\param{unsigned char
}{ r1
},
\param{unsigned char
}{ g1
},
\param{unsigned char
}{ b1
},
489 \param{unsigned char
}{ r2
},
\param{unsigned char
}{ g2
},
\param{unsigned char
}{ b2
}}
491 Replaces the colour specified by
{\it r1,g1,b1
} by the colour
{\it r2,g2,b2
}.
493 \membersection{wxImage::Rescale
}\label{wximagerescale
}
495 \func{wxImage \&
}{Rescale
}{\param{int
}{ width
},
\param{int
}{ height
}}
497 Changes the size of the image in-place: after a call to this function, the
498 image will have the given width and height.
500 Returns the (modified) image itself.
504 \helpref{Scale
}{wximagescale
}
506 \membersection{wxImage::Scale
}\label{wximagescale
}
508 \constfunc{wxImage
}{Scale
}{\param{int
}{ width
},
\param{int
}{ height
}}
510 Returns a scaled version of the image. This is also useful for
511 scaling bitmaps in general as the only other way to scale bitmaps
512 is to blit a wxMemoryDC into another wxMemoryDC.
514 It may be mentioned that the GTK port uses this function internally
515 to scale bitmaps when using mapping mode in wxDC.
520 // get the bitmap from somewhere
523 // rescale it to have size of
32*
32
524 if ( bmp.GetWidth() !=
32 || bmp.GetHeight() !=
32 )
527 bmp = image.Scale(
32,
32).ConvertToBitmap();
529 // another possibility:
530 image.Rescale(
32,
32);
538 \helpref{Rescale
}{wximagerescale
}
540 \membersection{wxImage::SetData
}\label{wximagesetdata
}
542 \func{void
}{SetData
}{\param{unsigned char*
}{data
}}
544 Sets the image data without performing checks. The data given must have
545 the size (width*height*
3) or results will be unexpected. Don't use this
546 method if you aren't sure you know what you are doing.
548 \membersection{wxImage::SetMask
}\label{wximagesetmask
}
550 \func{void
}{SetMask
}{\param{bool
}{ hasMask = TRUE
}}
552 Specifies whether there is a mask or not. The area of the mask is determined by the current mask colour.
554 \membersection{wxImage::SetMaskColour
}\label{wximagesetmaskcolour
}
556 \func{void
}{SetMaskColour
}{\param{unsigned char
}{red
},
\param{unsigned char
}{blue
},
\param{unsigned char
}{green
}}
558 Sets the mask colour for this image (and tells the image to use the mask).
560 \membersection{wxImage::SetRGB
}\label{wximagesetrgb
}
562 \func{void
}{SetRGB
}{\param{int
}{x
},
\param{int
}{y
},
\param{unsigned char
}{red
},
\param{unsigned char
}{blue
},
\param{unsigned char
}{green
}}
564 Sets the pixel at the given coordinate. This routine performs bounds-checks
565 for the coordinate so it can be considered a safe way to manipulate the
566 data, but in some cases this might be too slow so that the data will have to
567 be set directly. In that case you will have to get access to the image data
568 using the
\helpref{GetData
}{wximagegetdata
} method.
570 \membersection{wxImage::operator $=$
}
572 \func{wxImage\&
}{operator $=$
}{\param{const wxImage\&
}{image
}}
574 Assignment operator. This operator does not copy any data, but instead
575 passes a pointer to the data in
{\it image
} and increments a reference
576 counter. It is a fast operation.
578 \wxheading{Parameters
}
580 \docparam{image
}{Image to assign.
}
582 \wxheading{Return value
}
584 Returns 'this' object.
586 \membersection{wxImage::operator $==$
}
588 \func{bool
}{operator $==$
}{\param{const wxImage\&
}{image
}}
590 Equality operator. This operator tests whether the internal data pointers are
593 \wxheading{Parameters
}
595 \docparam{image
}{Image to compare with 'this'
}
597 \wxheading{Return value
}
599 Returns TRUE if the images were effectively equal, FALSE otherwise.
601 \membersection{wxImage::operator $!=$
}
603 \func{bool
}{operator $!=$
}{\param{const wxImage\&
}{image
}}
605 Inequality operator. This operator tests whether the internal data pointers are
606 unequal (a fast test).
608 \wxheading{Parameters
}
610 \docparam{image
}{Image to compare with 'this'
}
612 \wxheading{Return value
}
614 Returns TRUE if the images were unequal, FALSE otherwise.
616 \section{\class{wxImageHandler
}}\label{wximagehandler
}
618 This is the base class for implementing image file loading/saving, and image creation from data.
619 It is used within wxImage and is not normally seen by the application.
621 If you wish to extend the capabilities of wxImage, derive a class from wxImageHandler
622 and add the handler using
\helpref{wxImage::AddHandler
}{wximageaddhandler
} in your
623 application initialisation.
625 \wxheading{Note (Legal Issue)
}
627 This software is based in part on the work of the Independent JPEG Group.
629 (Applies when wxWindows is linked with JPEG support. wxJPEGHandler uses libjpeg
632 \wxheading{Derived from
}
634 \helpref{wxObject
}{wxobject
}
636 \wxheading{Include files
}
642 \helpref{wxImage
}{wximage
}
643 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}
645 \latexignore{\rtfignore{\wxheading{Members
}}}
647 \membersection{wxImageHandler::wxImageHandler
}\label{wximagehandlerconstr
}
649 \func{}{wxImageHandler
}{\void}
651 Default constructor. In your own default constructor, initialise the members
652 m
\_name, m
\_extension and m
\_type.
654 \membersection{wxImageHandler::
\destruct{wxImageHandler
}}
656 \func{}{\destruct{wxImageHandler
}}{\void}
658 Destroys the wxImageHandler object.
660 \membersection{wxImageHandler::GetName
}
662 \constfunc{wxString
}{GetName
}{\void}
664 Gets the name of this handler.
666 \membersection{wxImageHandler::GetExtension
}
668 \constfunc{wxString
}{GetExtension
}{\void}
670 Gets the file extension associated with this handler.
672 \membersection{wxImageHandler::GetImageCount
}\label{wximagehandlergetimagecount
}
674 \func{int
}{GetImageCount
}{\param{wxInputStream\&
}{ stream
}}
676 If the image file contains more than one image and the image handler is capable
677 of retrieving these individually, this function will return the number of
680 \docparam{stream
}{Opened input stream for reading image file.
}
682 \wxheading{Return value
}
684 Number of available images. For most image handles, this defaults to
1.
686 \membersection{wxImageHandler::GetType
}
688 \constfunc{long
}{GetType
}{\void}
690 Gets the image type associated with this handler.
692 \membersection{wxImageHandler::GetMimeType
}
694 \constfunc{wxString
}{GetMimeType
}{\void}
696 Gets the MIME type associated with this handler.
698 \membersection{wxImageHandler::LoadFile
}\label{wximagehandlerloadfile
}
700 \func{bool
}{LoadFile
}{\param{wxImage*
}{image
},
\param{wxInputStream\&
}{ stream
},
\param{bool
}{ verbose=TRUE
},
\param{int
}{ index=
0}}
702 Loads a image from a stream, putting the resulting data into
{\it image
}. If the image file contains
703 more than one image and the image handler is capable of retrieving these individually,
{\it index
}
704 indicates which image to read from the stream.
706 \wxheading{Parameters
}
708 \docparam{image
}{The image object which is to be affected by this operation.
}
710 \docparam{stream
}{Opened input stream for reading images.
}
712 \docparam{verbose
}{If set to TRUE, errors reported by the image handler will produce wxLogMessages.
}
714 \docparam{index
}{The index of the image in the file (starting from zero).
}
716 \wxheading{Return value
}
718 TRUE if the operation succeeded, FALSE otherwise.
722 \helpref{wxImage::LoadFile
}{wximageloadfile
}\\
723 \helpref{wxImage::SaveFile
}{wximagesavefile
}\\
724 \helpref{wxImageHandler::SaveFile
}{wximagehandlersavefile
}
726 \membersection{wxImageHandler::SaveFile
}\label{wximagehandlersavefile
}
728 \func{bool
}{SaveFile
}{\param{wxImage*
}{image
},
\param{wxOutputStream\&
}{stream
}}
730 Saves a image in the output stream.
732 \wxheading{Parameters
}
734 \docparam{image
}{The image object which is to be affected by this operation.
}
736 \docparam{stream
}{An opened stream for writing images.
}
738 \wxheading{Return value
}
740 TRUE if the operation succeeded, FALSE otherwise.
744 \helpref{wxImage::LoadFile
}{wximageloadfile
}\\
745 \helpref{wxImage::SaveFile
}{wximagesavefile
}\\
746 \helpref{wxImageHandler::LoadFile
}{wximagehandlerloadfile
}
748 \membersection{wxImageHandler::SetName
}
750 \func{void
}{SetName
}{\param{const wxString\&
}{name
}}
752 Sets the handler name.
754 \wxheading{Parameters
}
756 \docparam{name
}{Handler name.
}
758 \membersection{wxImageHandler::SetExtension
}
760 \func{void
}{SetExtension
}{\param{const wxString\&
}{extension
}}
762 Sets the handler extension.
764 \wxheading{Parameters
}
766 \docparam{extension
}{Handler extension.
}
768 \membersection{wxImageHandler::SetType
}
770 \func{void
}{SetType
}{\param{long
}{type
}}
772 Sets the handler type.
774 \wxheading{Parameters
}
776 \docparam{name
}{Handler type.
}
779 \membersection{wxImageHandler::SetMimeType
}
781 \func{void
}{SetMimeType
}{\param{const wxString\&
}{mimetype
}}
783 Sets the handler MIME type.
785 \wxheading{Parameters
}
787 \docparam{mimename
}{Handler MIME type.
}