#if wxUSE_IMAGE
+#define wxIMAGE_OPTION_FILENAME wxString(_T("FileName"))
+
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxImageHandler: public wxObject
{
public:
- wxImageHandler() { m_name = ""; m_extension = ""; m_type = 0; }
+ wxImageHandler()
+ : m_name(""), m_extension(""), m_mime(), m_type(0)
+ { }
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual int GetImageCount( wxInputStream& stream );
- bool CanRead( wxInputStream& stream ) { return DoCanRead(stream); }
+ bool CanRead( wxInputStream& stream ) { return CallDoCanRead(stream); }
bool CanRead( const wxString& name );
#endif // wxUSE_STREAMS
protected:
#if wxUSE_STREAMS
virtual bool DoCanRead( wxInputStream& stream ) = 0;
+
+ // save the stream position, call DoCanRead() and restore the position
+ bool CallDoCanRead(wxInputStream& stream);
#endif // wxUSE_STREAMS
wxString m_name;
wxImage( const wxImage& image );
wxImage( const wxImage* image );
-#if wxUSE_GUI
+#if WXWIN_COMPATIBILITY_2_2 && wxUSE_GUI
// convertion to/from wxBitmap (deprecated, use wxBitmap's methods instead):
wxImage( const wxBitmap &bitmap );
wxBitmap ConvertToBitmap() const;
virtual bool LoadFile( wxInputStream& stream, const wxString& mimetype, int index = -1 );
#endif
+ virtual bool SaveFile( const wxString& name ) const;
virtual bool SaveFile( const wxString& name, int type ) const;
virtual bool SaveFile( const wxString& name, const wxString& mimetype ) const;