This is the base class for implementing bitmap file loading/saving, and bitmap creation from data. It is used within wxBitmap and is not normally seen by the application.
If you wish to extend the capabilities of wxBitmap, derive a class from wxBitmapHandler and add the handler using wxBitmap::AddHandler in your application initialisation.
Derived from
Include files
<wx/bitmap.h>
See also
Members
wxBitmapHandler::wxBitmapHandler
wxBitmapHandler::~wxBitmapHandler
wxBitmapHandler::Create
wxBitmapHandler::GetName
wxBitmapHandler::GetExtension
wxBitmapHandler::GetType
wxBitmapHandler::LoadFile
wxBitmapHandler::SaveFile
wxBitmapHandler::SetName
wxBitmapHandler::SetExtension
wxBitmapHandler::SetType
wxBitmapHandler()
Default constructor. In your own default constructor, initialise the members m_name, m_extension and m_type.
~wxBitmapHandler()
Destroys the wxBitmapHandler object.
virtual bool Create(wxBitmap* bitmap, const void* data, int type, int width, int height, int depth = -1)
Creates a bitmap from the given data, which can be of arbitrary type. The wxBitmap object bitmap is manipulated by this function.
Parameters
bitmap
width
height
depth
data
type
Return value
true if the call succeeded, false otherwise (the default).
const wxString& GetName() const
Gets the name of this handler.
const wxString& GetExtension() const
Gets the file extension associated with this handler.
long GetType() const
Gets the bitmap type associated with this handler.
bool LoadFile(wxBitmap* bitmap, const wxString& name, long type)
Loads a bitmap from a file or resource, putting the resulting data into bitmap.
Parameters
bitmap
name
type
Return value
true if the operation succeeded, false otherwise.
See also
wxBitmap::LoadFile
wxBitmap::SaveFile
wxBitmapHandler::SaveFile
bool SaveFile(wxBitmap* bitmap, const wxString& name, int type, wxPalette* palette = NULL)
Saves a bitmap in the named file.
Parameters
bitmap
name
type
palette
Return value
true if the operation succeeded, false otherwise.
See also
wxBitmap::LoadFile
wxBitmap::SaveFile
wxBitmapHandler::LoadFile
void SetName(const wxString& name)
Sets the handler name.
Parameters
name
void SetExtension(const wxString& extension)
Sets the handler extension.
Parameters
extension
void SetType(long type)
Sets the handler type.
Parameters
name