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).
}
32 \twocolitem{{\bf \indexit{wxTIFFHandler
}}}{For loading and saving.
}
35 When saving in PCX format,
{\bf wxPCXHandler
} will count the number of
36 different colours in the image; if there are
256 or less colours, it will
37 save as
8 bit, else it will save as
24 bit.
39 Loading PNMs only works for ASCII or raw RGB images. When saving in
40 PNM format,
{\bf wxPNMHandler
} will always save as raw RGB.
42 \wxheading{Derived from
}
44 \helpref{wxObject
}{wxobject
}
46 \wxheading{Include files
}
52 \helpref{wxBitmap
}{wxbitmap
},
53 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}
55 \latexignore{\rtfignore{\wxheading{Members
}}}
57 \membersection{wxImage::wxImage
}\label{wximageconstr
}
59 \func{}{wxImage
}{\void}
63 \func{}{wxImage
}{\param{const wxImage\&
}{image
}}
67 \func{}{wxImage
}{\param{const wxBitmap\&
}{ bitmap
}}
69 Constructs an image from a platform-dependent bitmap. This preserves
70 mask information so that bitmaps and images can be converted back
71 and forth without loss in that respect.
73 \func{}{wxImage
}{\param{int
}{ width
},
\param{int
}{ height
}}
75 Creates an image with the given width and height.
77 \func{}{wxImage
}{\param{const wxString\&
}{name
},
\param{long
}{ type = wxBITMAP
\_TYPE\_ANY}}
79 \func{}{wxImage
}{\param{const wxString\&
}{name
},
\param{const wxString\&
}{ mimetype
}}
81 Loads an image from a file.
83 \func{}{wxImage
}{\param{wxInputStream\&
}{stream
},
\param{long
}{ type = wxBITMAP
\_TYPE\_ANY}}
85 \func{}{wxImage
}{\param{wxInputStream\&
}{stream
},
\param{const wxString\&
}{ mimetype
}}
87 Loads an image from an input stream.
89 \wxheading{Parameters
}
91 \docparam{width
}{Specifies the width of the image.
}
93 \docparam{height
}{Specifies the height of the image.
}
95 \docparam{name
}{Name of the file from which to load the image.
}
97 \docparam{stream
}{Opened input stream from which to load the image. Currently, the stream must support seeking.
}
99 \docparam{type
}{May be one of the following:
103 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_BMP}}}{Load a Windows bitmap file.
}
104 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_GIF}}}{Load a GIF bitmap file.
}
105 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_JPEG}}}{Load a JPEG bitmap file.
}
106 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_PNG}}}{Load a PNG bitmap file.
}
107 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_PCX}}}{Load a PCX bitmap file.
}
108 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_PNM}}}{Load a PNM bitmap file.
}
109 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_TIF}}}{Load a TIFF bitmap file.
}
110 \twocolitem{{\bf \indexit{wxBITMAP
\_TYPE\_ANY}}}{Will try to autodetect the format.
}
113 \docparam{mimetype
}{MIME type string (for example 'image/jpeg')
}
117 Depending on how wxWindows has been configured, not all formats may be available.
119 Note : any handler other than BMP must be previously
120 initialized with
\helpref{wxImage::AddHandler
}{wximageaddhandler
} or
121 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}.
125 \helpref{wxImage::LoadFile
}{wximageloadfile
}
127 \pythonnote{Constructors supported by wxPython are:
\par
128 \indented{2cm
}{\begin{twocollist
}
129 \twocolitem{{\bf wxImage(name, flag)
}}{Loads an image from a file
}
130 \twocolitem{{\bf wxNullImage()
}}{Create a null image (has no size or
132 \twocolitem{{\bf wxEmptyImage(width, height)
}}{Creates an empty image
134 \twocolitem{{\bf wxImageFromMime(name, mimetype
}}{Creates an image from
135 the given file of the given mimetype
}
136 \twocolitem{{\bf wxImageFromBitmap(bitmap)
}}{Creates an image from a
137 platform-dependent bitmap
}
141 \membersection{wxImage::
\destruct{wxImage
}}
143 \func{}{\destruct{wxImage
}}{\void}
147 \membersection{wxImage::AddHandler
}\label{wximageaddhandler
}
149 \func{static void
}{AddHandler
}{\param{wxImageHandler*
}{ handler
}}
151 Adds a handler to the end of the static list of format handlers.
153 \docparam{handler
}{A new image format handler object. There is usually only one instance
154 of a given handler class in an application session.
}
158 \helpref{wxImageHandler
}{wximagehandler
}
160 \pythonnote{In wxPython this static method is named
{\tt wxImage_AddHandler
}.
}
161 \membersection{wxImage::CleanUpHandlers
}
163 \func{static void
}{CleanUpHandlers
}{\void}
165 Deletes all image handlers.
167 This function is called by wxWindows on exit.
169 \membersection{wxImage::ConvertToBitmap
}\label{wximageconverttobitmap
}
171 \constfunc{wxBitmap
}{ConvertToBitmap
}{\void}
173 Converts the image to a platform-specific bitmap object. This has to be done
174 to actually display an image as you cannot draw an image directly on a window.
175 The resulting bitmap will use the colour depth of the current system which entails
176 that a colour reduction has to take place.
178 When in
8-bit mode (PseudoColour mode), the GTK port will use a
color cube created
179 on program start-up to look up colors. This ensures a very fast conversion, but
180 the image quality won't be perfect (and could be better for photo images using more
181 sophisticated dithering algorithms).
183 \membersection{wxImage::Create
}\label{wximagecreate
}
185 \func{bool
}{Create
}{\param{int
}{ width
},
\param{int
}{ height
}}
187 Creates a fresh image.
189 \wxheading{Parameters
}
191 \docparam{width
}{The width of the image in pixels.
}
193 \docparam{height
}{The height of the image in pixels.
}
195 \wxheading{Return value
}
197 TRUE if the call succeeded, FALSE otherwise.
199 \membersection{wxImage::Destroy
}\label{wximagedestroy
}
201 \func{bool
}{Destroy
}{\void}
203 Destroys the image data.
205 \membersection{wxImage::FindHandler
}
207 \func{static wxImageHandler*
}{FindHandler
}{\param{const wxString\&
}{name
}}
209 Finds the handler with the given name.
211 \func{static wxImageHandler*
}{FindHandler
}{\param{const wxString\&
}{extension
},
\param{long
}{ imageType
}}
213 Finds the handler associated with the given extension and type.
215 \func{static wxImageHandler*
}{FindHandler
}{\param{long
}{imageType
}}
217 Finds the handler associated with the given image type.
219 \func{static wxImageHandler*
}{FindHandlerMime
}{\param{const wxString\&
}{mimetype
}}
221 Finds the handler associated with the given MIME type.
223 \docparam{name
}{The handler name.
}
225 \docparam{extension
}{The file extension, such as ``bmp".
}
227 \docparam{imageType
}{The image type, such as wxBITMAP
\_TYPE\_BMP.
}
229 \docparam{mimetype
}{MIME type.
}
231 \wxheading{Return value
}
233 A pointer to the handler if found, NULL otherwise.
237 \helpref{wxImageHandler
}{wximagehandler
}
239 \membersection{wxImage::GetBlue
}\label{wximagegetblue
}
241 \constfunc{unsigned char
}{GetBlue
}{\param{int
}{ x
},
\param{int
}{ y
}}
243 Returns the blue intensity at the given coordinate.
245 \membersection{wxImage::GetData
}\label{wximagegetdata
}
247 \constfunc{unsigned char*
}{GetData
}{\void}
249 Returns the image data as an array. This is most often used when doing
250 direct image manipulation. The return value points to an array of
251 chararcters in RGBGBRGB... format.
253 \membersection{wxImage::GetGreen
}\label{wximagegetgreen
}
255 \constfunc{unsigned char
}{GetGreen
}{\param{int
}{ x
},
\param{int
}{ y
}}
257 Returns the green intensity at the given coordinate.
259 \membersection{wxImage::GetRed
}\label{wximagegetred
}
261 \constfunc{unsigned char
}{GetRed
}{\param{int
}{ x
},
\param{int
}{ y
}}
263 Returns the red intensity at the given coordinate.
265 \membersection{wxImage::GetHandlers
}
267 \func{static wxList\&
}{GetHandlers
}{\void}
269 Returns the static list of image format handlers.
273 \helpref{wxImageHandler
}{wximagehandler
}
275 \membersection{wxImage::GetHeight
}\label{wximagegetheight
}
277 \constfunc{int
}{GetHeight
}{\void}
279 Gets the height of the image in pixels.
281 \membersection{wxImage::GetMaskBlue
}\label{wximagegetmaskblue
}
283 \constfunc{unsigned char
}{GetMaskBlue
}{\void}
285 Gets the blue value of the mask colour.
287 \membersection{wxImage::GetMaskGreen
}\label{wximagegetmaskgreen
}
289 \constfunc{unsigned char
}{GetMaskGreen
}{\void}
291 Gets the green value of the mask colour.
293 \membersection{wxImage::GetMaskRed
}\label{wximagegetmaskred
}
295 \constfunc{unsigned char
}{GetMaskRed
}{\void}
297 Gets the red value of the mask colour.
299 \membersection{wxImage::GetSubImage
}\label{wximagegetsubimage
}
301 \constfunc{wxImage
}{GetSubImage
}{\param{const wxRect\&
}{ rect
}}
303 Returns a sub image of the current one as long as the rect belongs entirely to
306 \membersection{wxImage::GetWidth
}\label{wximagegetwidth
}
308 \constfunc{int
}{GetWidth
}{\void}
310 Gets the width of the image in pixels.
314 \helpref{wxImage::GetHeight
}{wximagegetheight
}
316 \membersection{wxImage::HasMask
}\label{wximagehasmask
}
318 \constfunc{bool
}{HasMask
}{\void}
320 Returns TRUE if there is a mask active, FALSE otherwise.
322 \membersection{wxImage::InitStandardHandlers
}
324 \func{static void
}{InitStandardHandlers
}{\void}
326 Internal use only. Adds standard image format handlers. It only install BMP
327 for the time being, which is used by wxBitmap.
329 This function is called by wxWindows on startup, and shouldn't be called by
334 \helpref{wxImageHandler
}{wximagehandler
}
335 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}
337 \membersection{wxImage::InsertHandler
}
339 \func{static void
}{InsertHandler
}{\param{wxImageHandler*
}{ handler
}}
341 Adds a handler at the start of the static list of format handlers.
343 \docparam{handler
}{A new image format handler object. There is usually only one instance
344 of a given handler class in an application session.
}
348 \helpref{wxImageHandler
}{wximagehandler
}
350 \membersection{wxImage::LoadFile
}\label{wximageloadfile
}
352 \func{bool
}{LoadFile
}{\param{const wxString\&
}{ name
},
\param{long
}{ type = wxBITMAP
\_TYPE\_ANY}}
354 \func{bool
}{LoadFile
}{\param{const wxString\&
}{ name
},
\param{const wxString\&
}{ mimetype
}}
356 Loads an image from a file. If no handler type is provided, the library will
357 try to autodetect the format.
359 \func{bool
}{LoadFile
}{\param{wxInputStream\&
}{ stream
},
\param{long
}{ type
}}
361 \func{bool
}{LoadFile
}{\param{wxInputStream\&
}{ stream
},
\param{const wxString\&
}{ mimetype
}}
363 Loads an image from an input stream.
365 \wxheading{Parameters
}
367 \docparam{name
}{Name of the file from which to load the image.
}
369 \docparam{stream
}{Opened input stream from which to load the image. Currently, the stream must support seeking.
}
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\_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.
}
381 \twocolitem{{\bf wxBITMAP
\_TYPE\_TIF}}{Load a TIFF image file.
}
382 \twocolitem{{\bf wxBITMAP
\_TYPE\_ANY}}{Will try to autodetect the format.
}
385 \docparam{mimetype
}{MIME type string (for example 'image/jpeg')
}
389 Depending on how wxWindows has been configured, not all formats may be available.
391 \wxheading{Return value
}
393 TRUE if the operation succeeded, FALSE otherwise.
397 \helpref{wxImage::SaveFile
}{wximagesavefile
}
399 \pythonnote{In place of a single overloaded method name, wxPython
400 implements the following methods:
\par
401 \indented{2cm
}{\begin{twocollist
}
402 \twocolitem{{\bf LoadFile(filename, type)
}}{Loads an image of the given
404 \twocolitem{{\bf LoadMimeFile(filename, mimetype)
}}{Loads an image of the given
405 mimetype from a file
}
410 \membersection{wxImage::Ok
}\label{wximageok
}
412 \constfunc{bool
}{Ok
}{\void}
414 Returns TRUE if image data is present.
416 \membersection{wxImage::RemoveHandler
}
418 \func{static bool
}{RemoveHandler
}{\param{const wxString\&
}{name
}}
420 Finds the handler with the given name, and removes it. The handler
423 \docparam{name
}{The handler name.
}
425 \wxheading{Return value
}
427 TRUE if the handler was found and removed, FALSE otherwise.
431 \helpref{wxImageHandler
}{wximagehandler
}
433 \membersection{wxImage::SaveFile
}\label{wximagesavefile
}
435 \func{bool
}{SaveFile
}{\param{const wxString\&
}{name
},
\param{int
}{ type
}}
437 \func{bool
}{SaveFile
}{\param{const wxString\&
}{name
},
\param{const wxString\&
}{ mimetype
}}
439 Saves a image in the named file.
441 \func{bool
}{SaveFile
}{\param{wxOutputStream\&
}{stream
},
\param{int
}{ type
}}
443 \func{bool
}{SaveFile
}{\param{wxOutputStream\&
}{stream
},
\param{const wxString\&
}{ mimetype
}}
445 Saves a image in the given stream.
447 \wxheading{Parameters
}
449 \docparam{name
}{Name of the file to save the image to.
}
451 \docparam{stream
}{Opened output stream to save the image to.
}
453 \docparam{type
}{Currently three types can be used:
457 \twocolitem{{\bf wxBITMAP
\_TYPE\_JPEG}}{Save a JPEG image file.
}
458 \twocolitem{{\bf wxBITMAP
\_TYPE\_PNG}}{Save a PNG image file.
}
459 \twocolitem{{\bf wxBITMAP
\_TYPE\_PCX}}{Save a PCX image file (tries to save as
8-bit if possible, falls back to
24-bit otherwise).
}
460 \twocolitem{{\bf wxBITMAP
\_TYPE\_PNM}}{Save a PNM image file (as raw RGB always).
}
461 \twocolitem{{\bf wxBITMAP
\_TYPE\_TIF}}{Save a TIFF image file.
}
464 \docparam{mimetype
}{MIME type.
}
466 \wxheading{Return value
}
468 TRUE if the operation succeeded, FALSE otherwise.
472 Depending on how wxWindows has been configured, not all formats may be available.
476 \helpref{wxImage::LoadFile
}{wximageloadfile
}
478 \pythonnote{In place of a single overloaded method name, wxPython
479 implements the following methods:
\par
480 \indented{2cm
}{\begin{twocollist
}
481 \twocolitem{{\bf SaveFile(filename, type)
}}{Saves the image using the given
482 type to the named file
}
483 \twocolitem{{\bf SaveMimeFile(filename, mimetype)
}}{Saves the image using the given
484 mimetype to the named file
}
488 \membersection{wxImage::Replace
}\label{wximagereplace
}
490 \func{void
}{Replace
}{\param{unsigned char
}{ r1
},
\param{unsigned char
}{ g1
},
\param{unsigned char
}{ b1
},
491 \param{unsigned char
}{ r2
},
\param{unsigned char
}{ g2
},
\param{unsigned char
}{ b2
}}
493 Replaces the colour specified by
{\it r1,g1,b1
} by the colour
{\it r2,g2,b2
}.
495 \membersection{wxImage::Rescale
}\label{wximagerescale
}
497 \func{wxImage \&
}{Rescale
}{\param{int
}{ width
},
\param{int
}{ height
}}
499 Changes the size of the image in-place: after a call to this function, the
500 image will have the given width and height.
502 Returns the (modified) image itself.
506 \helpref{Scale
}{wximagescale
}
508 \membersection{wxImage::Scale
}\label{wximagescale
}
510 \constfunc{wxImage
}{Scale
}{\param{int
}{ width
},
\param{int
}{ height
}}
512 Returns a scaled version of the image. This is also useful for
513 scaling bitmaps in general as the only other way to scale bitmaps
514 is to blit a wxMemoryDC into another wxMemoryDC.
516 It may be mentioned that the GTK port uses this function internally
517 to scale bitmaps when using mapping mode in wxDC.
522 // get the bitmap from somewhere
525 // rescale it to have size of
32*
32
526 if ( bmp.GetWidth() !=
32 || bmp.GetHeight() !=
32 )
529 bmp = image.Scale(
32,
32).ConvertToBitmap();
531 // another possibility:
532 image.Rescale(
32,
32);
540 \helpref{Rescale
}{wximagerescale
}
542 \membersection{wxImage::SetData
}\label{wximagesetdata
}
544 \func{void
}{SetData
}{\param{unsigned char*
}{data
}}
546 Sets the image data without performing checks. The data given must have
547 the size (width*height*
3) or results will be unexpected. Don't use this
548 method if you aren't sure you know what you are doing.
550 \membersection{wxImage::SetMask
}\label{wximagesetmask
}
552 \func{void
}{SetMask
}{\param{bool
}{ hasMask = TRUE
}}
554 Specifies whether there is a mask or not. The area of the mask is determined by the current mask colour.
556 \membersection{wxImage::SetMaskColour
}\label{wximagesetmaskcolour
}
558 \func{void
}{SetMaskColour
}{\param{unsigned char
}{red
},
\param{unsigned char
}{blue
},
\param{unsigned char
}{green
}}
560 Sets the mask colour for this image (and tells the image to use the mask).
562 \membersection{wxImage::SetRGB
}\label{wximagesetrgb
}
564 \func{void
}{SetRGB
}{\param{int
}{x
},
\param{int
}{y
},
\param{unsigned char
}{red
},
\param{unsigned char
}{blue
},
\param{unsigned char
}{green
}}
566 Sets the pixel at the given coordinate. This routine performs bounds-checks
567 for the coordinate so it can be considered a safe way to manipulate the
568 data, but in some cases this might be too slow so that the data will have to
569 be set directly. In that case you will have to get access to the image data
570 using the
\helpref{GetData
}{wximagegetdata
} method.
572 \membersection{wxImage::operator $=$
}
574 \func{wxImage\&
}{operator $=$
}{\param{const wxImage\&
}{image
}}
576 Assignment operator. This operator does not copy any data, but instead
577 passes a pointer to the data in
{\it image
} and increments a reference
578 counter. It is a fast operation.
580 \wxheading{Parameters
}
582 \docparam{image
}{Image to assign.
}
584 \wxheading{Return value
}
586 Returns 'this' object.
588 \membersection{wxImage::operator $==$
}
590 \func{bool
}{operator $==$
}{\param{const wxImage\&
}{image
}}
592 Equality operator. This operator tests whether the internal data pointers are
595 \wxheading{Parameters
}
597 \docparam{image
}{Image to compare with 'this'
}
599 \wxheading{Return value
}
601 Returns TRUE if the images were effectively equal, FALSE otherwise.
603 \membersection{wxImage::operator $!=$
}
605 \func{bool
}{operator $!=$
}{\param{const wxImage\&
}{image
}}
607 Inequality operator. This operator tests whether the internal data pointers are
608 unequal (a fast test).
610 \wxheading{Parameters
}
612 \docparam{image
}{Image to compare with 'this'
}
614 \wxheading{Return value
}
616 Returns TRUE if the images were unequal, FALSE otherwise.
618 \section{\class{wxImageHandler
}}\label{wximagehandler
}
620 This is the base class for implementing image file loading/saving, and image creation from data.
621 It is used within wxImage and is not normally seen by the application.
623 If you wish to extend the capabilities of wxImage, derive a class from wxImageHandler
624 and add the handler using
\helpref{wxImage::AddHandler
}{wximageaddhandler
} in your
625 application initialisation.
627 \wxheading{Note (Legal Issue)
}
629 This software is based in part on the work of the Independent JPEG Group.
631 (Applies when wxWindows is linked with JPEG support. wxJPEGHandler uses libjpeg
634 \wxheading{Derived from
}
636 \helpref{wxObject
}{wxobject
}
638 \wxheading{Include files
}
644 \helpref{wxImage
}{wximage
}
645 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}
647 \latexignore{\rtfignore{\wxheading{Members
}}}
649 \membersection{wxImageHandler::wxImageHandler
}\label{wximagehandlerconstr
}
651 \func{}{wxImageHandler
}{\void}
653 Default constructor. In your own default constructor, initialise the members
654 m
\_name, m
\_extension and m
\_type.
656 \membersection{wxImageHandler::
\destruct{wxImageHandler
}}
658 \func{}{\destruct{wxImageHandler
}}{\void}
660 Destroys the wxImageHandler object.
662 \membersection{wxImageHandler::GetName
}
664 \constfunc{wxString
}{GetName
}{\void}
666 Gets the name of this handler.
668 \membersection{wxImageHandler::GetExtension
}
670 \constfunc{wxString
}{GetExtension
}{\void}
672 Gets the file extension associated with this handler.
674 \membersection{wxImageHandler::GetImageCount
}\label{wximagehandlergetimagecount
}
676 \func{int
}{GetImageCount
}{\param{wxInputStream\&
}{ stream
}}
678 If the image file contains more than one image and the image handler is capable
679 of retrieving these individually, this function will return the number of
682 \docparam{stream
}{Opened input stream for reading image data. Currently, the stream must support seeking.
}
684 \wxheading{Return value
}
686 Number of available images. For most image handles, this defaults to
1.
688 \membersection{wxImageHandler::GetType
}
690 \constfunc{long
}{GetType
}{\void}
692 Gets the image type associated with this handler.
694 \membersection{wxImageHandler::GetMimeType
}
696 \constfunc{wxString
}{GetMimeType
}{\void}
698 Gets the MIME type associated with this handler.
700 \membersection{wxImageHandler::LoadFile
}\label{wximagehandlerloadfile
}
702 \func{bool
}{LoadFile
}{\param{wxImage*
}{image
},
\param{wxInputStream\&
}{ stream
},
\param{bool
}{ verbose=TRUE
},
\param{int
}{ index=
0}}
704 Loads a image from a stream, putting the resulting data into
{\it image
}. If the image file contains
705 more than one image and the image handler is capable of retrieving these individually,
{\it index
}
706 indicates which image to read from the stream.
708 \wxheading{Parameters
}
710 \docparam{image
}{The image object which is to be affected by this operation.
}
712 \docparam{stream
}{Opened input stream for reading image data.
}
714 \docparam{verbose
}{If set to TRUE, errors reported by the image handler will produce wxLogMessages.
}
716 \docparam{index
}{The index of the image in the file (starting from zero).
}
718 \wxheading{Return value
}
720 TRUE if the operation succeeded, FALSE otherwise.
724 \helpref{wxImage::LoadFile
}{wximageloadfile
}\\
725 \helpref{wxImage::SaveFile
}{wximagesavefile
}\\
726 \helpref{wxImageHandler::SaveFile
}{wximagehandlersavefile
}
728 \membersection{wxImageHandler::SaveFile
}\label{wximagehandlersavefile
}
730 \func{bool
}{SaveFile
}{\param{wxImage*
}{image
},
\param{wxOutputStream\&
}{stream
}}
732 Saves a image in the output stream.
734 \wxheading{Parameters
}
736 \docparam{image
}{The image object which is to be affected by this operation.
}
738 \docparam{stream
}{Opened output stream for writing the data.
}
740 \wxheading{Return value
}
742 TRUE if the operation succeeded, FALSE otherwise.
746 \helpref{wxImage::LoadFile
}{wximageloadfile
}\\
747 \helpref{wxImage::SaveFile
}{wximagesavefile
}\\
748 \helpref{wxImageHandler::LoadFile
}{wximagehandlerloadfile
}
750 \membersection{wxImageHandler::SetName
}
752 \func{void
}{SetName
}{\param{const wxString\&
}{name
}}
754 Sets the handler name.
756 \wxheading{Parameters
}
758 \docparam{name
}{Handler name.
}
760 \membersection{wxImageHandler::SetExtension
}
762 \func{void
}{SetExtension
}{\param{const wxString\&
}{extension
}}
764 Sets the handler extension.
766 \wxheading{Parameters
}
768 \docparam{extension
}{Handler extension.
}
770 \membersection{wxImageHandler::SetType
}
772 \func{void
}{SetType
}{\param{long
}{type
}}
774 Sets the handler type.
776 \wxheading{Parameters
}
778 \docparam{name
}{Handler type.
}
781 \membersection{wxImageHandler::SetMimeType
}
783 \func{void
}{SetMimeType
}{\param{const wxString\&
}{mimetype
}}
785 Sets the handler MIME type.
787 \wxheading{Parameters
}
789 \docparam{mimename
}{Handler MIME type.
}