]>
git.saurik.com Git - wxWidgets.git/blob - src/common/imaggif.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGIFHandler
4 // Author: Vaclav Slavik & Guillermo Rodriguez Garcia
6 // Copyright: (c) 1999 Vaclav Slavik & Guillermo Rodriguez Garcia
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 We don't put pragma implement in this file because it is already present in
15 // For compilers that support precompilation, includes "wx.h".
16 #include <wx/wxprec.h>
26 #if wxUSE_STREAMS && wxUSE_GIF
29 #include "wx/gifdecod.h"
30 #include "wx/wfstream.h"
33 #if !USE_SHARED_LIBRARIES
34 IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler
,wxImageHandler
)
37 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
41 bool wxGIFHandler::LoadFile( wxImage
*image
, wxInputStream
& stream
, bool verbose
)
47 decod
= new wxGIFDecoder(&stream
, TRUE
);
49 if ((error
= decod
->ReadGIF()) != E_OK
)
55 case E_FORMATO
: wxLogError(_T("wxGIFHandler: error in image format")); break;
56 case E_MEMORIA
: wxLogError(_T("wxGIFHandler: couldn't allocate memory")); break;
57 default: wxLogError(_T("wxGIFHandler: unknown error !!!"));
65 ok
= decod
->ConvertToImage(image
);
71 bool wxGIFHandler::SaveFile( wxImage
* WXUNUSED(image
),
72 wxOutputStream
& WXUNUSED(stream
), bool verbose
)
75 wxLogDebug(_T("wxGIFHandler is read-only!!"));
80 bool wxGIFHandler::CanRead( wxInputStream
& stream
)
85 decod
= new wxGIFDecoder(&stream
);
86 ok
= decod
->CanRead();
92 #endif // wxUSE_STREAMS && wxUSE_GIF