Contents Up Previous Next

wxBitmapHandler

Overview

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

wxObject

Include files

<wx/bitmap.h>

See also

wxBitmap, wxIcon, wxCursor

Members

wxBitmapHandler::wxBitmapHandler
wxBitmapHandler::~wxBitmapHandler
wxBitmapHandler::Create
wxBitmapHandler::GetName
wxBitmapHandler::GetExtension
wxBitmapHandler::GetType
wxBitmapHandler::LoadFile
wxBitmapHandler::SaveFile
wxBitmapHandler::SetName
wxBitmapHandler::SetExtension
wxBitmapHandler::SetType


wxBitmapHandler::wxBitmapHandler

wxBitmapHandler()

Default constructor. In your own default constructor, initialise the members m_name, m_extension and m_type.


wxBitmapHandler::~wxBitmapHandler

~wxBitmapHandler()

Destroys the wxBitmapHandler object.


wxBitmapHandler::Create

virtual bool Create(wxBitmap* bitmap, 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).


wxBitmapHandler::GetName

wxString GetName() const

Gets the name of this handler.


wxBitmapHandler::GetExtension

wxString GetExtension() const

Gets the file extension associated with this handler.


wxBitmapHandler::GetType

long GetType() const

Gets the bitmap type associated with this handler.


wxBitmapHandler::LoadFile

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


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


wxBitmapHandler::SetName

void SetName(const wxString& name)

Sets the handler name.

Parameters

name


wxBitmapHandler::SetExtension

void SetExtension(const wxString& extension)

Sets the handler extension.

Parameters

extension


wxBitmapHandler::SetType

void SetType(long type)

Sets the handler type.

Parameters

name