+ wxImageHandler *handler;
+
+ if (type==wxBITMAP_TYPE_ANY)
+ {
+ // here we can try to guess the handler according the extension,
+ // but we lose the stream name !?
+ // Probably we should write methods such as
+ // bool wxImageHandler::IsAppropriate(wxString&)
+ // bool wxImageHandler::IsAppropriate(sxInputStream&&)
+ // for png : see example.c
+ wxList &list=GetHandlers();
+ off_t pos=stream.TellI();
+
+ wxLogNull prevent_log;
+
+ for ( wxList::Node *node = list.GetFirst(); node; node = node->GetNext() )
+ {
+ handler=(wxImageHandler*)node->GetData();
+ //cout << handler->GetExtension() << endl;
+ if (handler->LoadFile( this, stream, FALSE )) return TRUE;
+ stream.SeekI(pos);
+ }
+
+ return FALSE;
+ }
+
+ handler = FindHandler(type);