Contents Up Previous Next

wxImageHandler

This 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 wxWindows is linked with JPEG support. wxJPEGHandler uses libjpeg created by IJG.)

Derived from

wxObject

Include files

<wx/image.h>

See also

wxImage

Members

wxImageHandler::wxImageHandler
wxImageHandler::~wxImageHandler
wxImageHandler::GetName
wxImageHandler::GetExtension
wxImageHandler::GetType
wxImageHandler::LoadFile
wxImageHandler::SaveFile
wxImageHandler::SetName
wxImageHandler::SetExtension
wxImageHandler::SetType


wxImageHandler::wxImageHandler

wxImageHandler()

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::GetName

wxString GetName() const

Gets the name of this handler.


wxImageHandler::GetExtension

wxString GetExtension() const

Gets the file extension associated with this handler.


wxImageHandler::GetType

long GetType() const

Gets the image type associated with this handler.


wxImageHandler::LoadFile

bool LoadFile(wxImage* image, wxInputStream& stream)

Loads a image from a stream, putting the resulting data into image.

Parameters

image

stream

Return value

TRUE if the operation succeeded, FALSE otherwise.

See also

wxImage::LoadFile
wxImage::SaveFile
wxImageHandler::SaveFile


wxImageHandler::SaveFile

bool 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::SetName

void SetName(const wxString& name)

Sets the handler name.

Parameters

name


wxImageHandler::SetExtension

void SetExtension(const wxString& extension)

Sets the handler extension.

Parameters

extension


wxImageHandler::SetType

void SetType(long type)

Sets the handler type.

Parameters

name