]>
git.saurik.com Git - wxWidgets.git/blob - src/common/imaggif.cpp
f719a2ad41dee11920c89b8d39943a71aa890f49
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGIFHandler
4 // Author: Vaclav Slavik & Guillermo Rodriguez Garcia
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
10 We don't put pragma implement in this file because it is already present in
14 // For compilers that support precompilation, includes "wx.h".
15 #include <wx/wxprec.h>
25 #if 1 // change this to #if wxUSE_GIF
28 #include "wx/gifdecod.h"
29 #include "wx/wfstream.h"
30 #include "wx/module.h"
33 #if !USE_SHARED_LIBRARIES
34 IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler
,wxImageHandler
)
39 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
43 bool wxGIFHandler::LoadFile( wxImage
*image
, wxInputStream
& stream
, bool verbose
)
48 decod
= new wxGIFDecoder(&stream
, TRUE
);
50 if (decod
->ReadGIF() != E_OK
)
53 wxLogDebug(_T("Error reading GIF"));
60 ok
= decod
->ConvertToImage(image
);
66 bool wxGIFHandler::SaveFile( wxImage
* WXUNUSED(image
),
67 wxOutputStream
& WXUNUSED(stream
), bool verbose
)
70 wxLogDebug(_T("wxGIFHandler is read-only!!"));
75 bool wxGIFHandler::CanRead( wxInputStream
& stream
)
80 decod
= new wxGIFDecoder(&stream
);
81 ok
= decod
->CanRead();