Added (dummy) handler for loading bitmap from file instead of resource.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2005-09-18 23:27:28 +00:00
parent fa4bc07cce
commit c90c34007a
2 changed files with 48 additions and 0 deletions

View File

@@ -162,6 +162,9 @@ public:
virtual bool LoadFile( int nId
,long lType = wxBITMAP_TYPE_BMP_RESOURCE
);
virtual bool LoadFile( const wxString& rName
,long lType = wxBITMAP_TYPE_XPM
);
virtual bool SaveFile( const wxString& rName
,int lType
,const wxPalette* pCmap = NULL
@@ -312,6 +315,12 @@ public:
,int nDesiredWidth
,int nDesiredHeight
);
virtual bool LoadFile( wxBitmap* pBitmap
,const wxString& rName
,long lFlags
,int nDesiredWidth
,int nDesiredHeight
);
virtual bool SaveFile( wxBitmap* pBitmap
,const wxString& rName
,int lType

View File

@@ -407,6 +407,34 @@ bool wxBitmap::CreateFromXpm(
#endif
} // end of wxBitmap::CreateFromXpm
bool wxBitmap::LoadFile(const wxString& filename, long type)
{
UnRef();
wxBitmapHandler *handler = wxDynamicCast(FindHandler(type), wxBitmapHandler);
if ( handler )
{
m_refData = new wxBitmapRefData;
return handler->LoadFile(this, filename, type, -1, -1);
}
#if wxUSE_IMAGE
else // no bitmap handler found
{
wxImage image;
if ( image.LoadFile( filename, type ) && image.Ok() )
{
*this = wxBitmap(image);
return true;
}
}
#endif // wxUSE_IMAGE
return false;
}
bool wxBitmap::LoadFile(
int nId
, long lType
@@ -1505,6 +1533,17 @@ bool wxBitmapHandler::LoadFile(
return false;
}
bool wxBitmapHandler::LoadFile(
wxBitmap* WXUNUSED(pBitmap)
, const wxString& WXUNUSED(rName)
, long WXUNUSED(lType)
, int WXUNUSED(nDesiredWidth)
, int WXUNUSED(nDesiredHeight)
)
{
return false;
}
bool wxBitmapHandler::SaveFile(
wxBitmap* WXUNUSED(pBitmap)
, const wxString& WXUNUSED(rName)