wximagehandlerthis is the base class for implementing image file loading/saving, and image creation from data. it is used within wximage and is not normally seen by the application. if you wish to extend the capabilities of wximage, derive a class from wximagehandler and add the handler using wximage::addhandler in your application initialisation. note (legal issue) this software is based in part on the work of the independent jpeg group. (applies when wxwidgets is linked with jpeg support. wxjpeghandler uses libjpeg created by ijg.) derived from include files <wx/image.h> see also wximage, wxinitallimagehandlers members
wximagehandler::wximagehandler
wximagehandler::wximagehandlerwximagehandler() default constructor. in your own default constructor, initialise the members m_name, m_extension and m_type.
wximagehandler::~wximagehandler~wximagehandler() destroys the wximagehandler object.
wximagehandler::getnameconst wxstring& getname() const gets the name of this handler.
wximagehandler::getextensionconst wxstring& getextension() const gets the file extension associated with this handler.
wximagehandler::getimagecountint getimagecount(wxinputstream& stream) if the image file contains more than one image and the image handler is capable of retrieving these individually, this function will return the number of available images. stream
return value number of available images. for most image handlers, this is 1 (exceptions are tiff and ico formats).
wximagehandler::gettypelong gettype() const gets the image type associated with this handler.
wximagehandler::getmimetypeconst wxstring& getmimetype() const gets the mime type associated with this handler.
wximagehandler::loadfilebool loadfile(wximage* image, wxinputstream& stream, bool verbose=true, int index=0) loads a image from a stream, putting the resulting data into image. if the image file contains more than one image and the image handler is capable of retrieving these individually, index indicates which image to read from the stream. parameters image
stream
verbose
index
return value true if the operation succeeded, false otherwise. see also wximage::loadfile, wximage::savefile, wximagehandler::savefile
wximagehandler::savefilebool savefile(wximage* image, wxoutputstream& stream) saves a image in the output stream. parameters image
stream
return value true if the operation succeeded, false otherwise. see also wximage::loadfile, wximage::savefile, wximagehandler::loadfile
wximagehandler::setnamevoid setname(const wxstring& name) sets the handler name. parameters name
wximagehandler::setextensionvoid setextension(const wxstring& extension) sets the handler extension. parameters extension
wximagehandler::setmimetypevoid setmimetype(const wxstring& mimetype) sets the handler mime type. parameters mimename
wximagehandler::settypevoid settype(long type) sets the handler type. parameters name
|