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:
@@ -162,6 +162,9 @@ public:
|
|||||||
virtual bool LoadFile( int nId
|
virtual bool LoadFile( int nId
|
||||||
,long lType = wxBITMAP_TYPE_BMP_RESOURCE
|
,long lType = wxBITMAP_TYPE_BMP_RESOURCE
|
||||||
);
|
);
|
||||||
|
virtual bool LoadFile( const wxString& rName
|
||||||
|
,long lType = wxBITMAP_TYPE_XPM
|
||||||
|
);
|
||||||
virtual bool SaveFile( const wxString& rName
|
virtual bool SaveFile( const wxString& rName
|
||||||
,int lType
|
,int lType
|
||||||
,const wxPalette* pCmap = NULL
|
,const wxPalette* pCmap = NULL
|
||||||
@@ -312,6 +315,12 @@ public:
|
|||||||
,int nDesiredWidth
|
,int nDesiredWidth
|
||||||
,int nDesiredHeight
|
,int nDesiredHeight
|
||||||
);
|
);
|
||||||
|
virtual bool LoadFile( wxBitmap* pBitmap
|
||||||
|
,const wxString& rName
|
||||||
|
,long lFlags
|
||||||
|
,int nDesiredWidth
|
||||||
|
,int nDesiredHeight
|
||||||
|
);
|
||||||
virtual bool SaveFile( wxBitmap* pBitmap
|
virtual bool SaveFile( wxBitmap* pBitmap
|
||||||
,const wxString& rName
|
,const wxString& rName
|
||||||
,int lType
|
,int lType
|
||||||
|
@@ -407,6 +407,34 @@ bool wxBitmap::CreateFromXpm(
|
|||||||
#endif
|
#endif
|
||||||
} // end of wxBitmap::CreateFromXpm
|
} // 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(
|
bool wxBitmap::LoadFile(
|
||||||
int nId
|
int nId
|
||||||
, long lType
|
, long lType
|
||||||
@@ -1505,6 +1533,17 @@ bool wxBitmapHandler::LoadFile(
|
|||||||
return false;
|
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(
|
bool wxBitmapHandler::SaveFile(
|
||||||
wxBitmap* WXUNUSED(pBitmap)
|
wxBitmap* WXUNUSED(pBitmap)
|
||||||
, const wxString& WXUNUSED(rName)
|
, const wxString& WXUNUSED(rName)
|
||||||
|
Reference in New Issue
Block a user