Add wxImage::CanRead, wasn't in 1.59 ?
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -290,10 +290,12 @@ public:
|
|||||||
unsigned char GetGreen( int x, int y );
|
unsigned char GetGreen( int x, int y );
|
||||||
unsigned char GetBlue( int x, int y );
|
unsigned char GetBlue( int x, int y );
|
||||||
|
|
||||||
|
static bool CanRead( const wxString& name );
|
||||||
virtual bool LoadFile( const wxString& name, long type = wxBITMAP_TYPE_ANY );
|
virtual bool LoadFile( const wxString& name, long type = wxBITMAP_TYPE_ANY );
|
||||||
virtual bool LoadFile( const wxString& name, const wxString& mimetype );
|
virtual bool LoadFile( const wxString& name, const wxString& mimetype );
|
||||||
|
|
||||||
#if wxUSE_STREAMS
|
#if wxUSE_STREAMS
|
||||||
|
static bool CanRead( wxInputStream& stream );
|
||||||
virtual bool LoadFile( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY );
|
virtual bool LoadFile( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY );
|
||||||
virtual bool LoadFile( wxInputStream& stream, const wxString& mimetype );
|
virtual bool LoadFile( wxInputStream& stream, const wxString& mimetype );
|
||||||
#endif
|
#endif
|
||||||
|
@@ -437,7 +437,31 @@ bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxImage::CanRead( const wxString &name )
|
||||||
|
{
|
||||||
#if wxUSE_STREAMS
|
#if wxUSE_STREAMS
|
||||||
|
wxFileInputStream stream(name);
|
||||||
|
return CanRead(stream);
|
||||||
|
#else
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if wxUSE_STREAMS
|
||||||
|
|
||||||
|
bool wxImage::CanRead( wxInputStream &stream )
|
||||||
|
{
|
||||||
|
wxList &list=GetHandlers();
|
||||||
|
|
||||||
|
for ( wxList::Node *node = list.GetFirst(); node; node = node->GetNext() )
|
||||||
|
{
|
||||||
|
wxImageHandler *handler=(wxImageHandler*)node->GetData();
|
||||||
|
if (handler->CanRead( stream ))
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxImage::LoadFile( wxInputStream& stream, long type )
|
bool wxImage::LoadFile( wxInputStream& stream, long type )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user