]>
git.saurik.com Git - wxWidgets.git/blob - src/common/imaggif.cpp
c487e75fa688e7dd29f577d0eb8aebbeba22cd47
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"
29 #include "wx/gifdecod.h"
30 #include "wx/wfstream.h"
33 #if !USE_SHARED_LIBRARIES
34 IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler
,wxImageHandler
)
37 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
43 bool wxGIFHandler::LoadFile( wxImage
*image
, wxInputStream
& stream
, bool verbose
, int WXUNUSED(index
) )
49 decod
= new wxGIFDecoder(&stream
, TRUE
);
51 if ((error
= decod
->ReadGIF()) != E_OK
)
57 case E_FORMATO
: wxLogError(_("GIF: Error in image format.")); break;
58 case E_MEMORIA
: wxLogError(_("GIF: Couldn't allocate memory.")); break;
59 default: wxLogError(_("GIF: Unknown error."));
67 ok
= decod
->ConvertToImage(image
);
73 bool wxGIFHandler::SaveFile( wxImage
* WXUNUSED(image
),
74 wxOutputStream
& WXUNUSED(stream
), bool verbose
)
77 wxLogDebug(wxT("wxGIFHandler is read-only!!"));
82 bool wxGIFHandler::DoCanRead( wxInputStream
& stream
)
87 decod
= new wxGIFDecoder(&stream
);
88 ok
= decod
->CanRead();
94 #endif // wxUSE_STREAMS