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:
@@ -437,7 +437,31 @@ bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxImage::CanRead( const wxString &name )
|
||||
{
|
||||
#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 )
|
||||
{
|
||||
|
Reference in New Issue
Block a user