]>
git.saurik.com Git - wxWidgets.git/blob - src/common/imaggif.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGIFHandler
4 // Author: Vaclav Slavik
5 // Based on wxGIFDecoder by 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>
27 #include "wx/gifdecod.h"
28 #include "wx/wfstream.h"
29 #include "wx/module.h"
32 IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler
,wxImageHandler
)
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
40 bool wxGIFHandler::LoadFile( wxImage
*image
, wxInputStream
& stream
, bool WXUNUSED(verbose
) )
45 decod
= new wxGIFDecoder(&stream
, TRUE
);
47 if (decod
->ReadGIF() != E_OK
)
49 wxLogDebug(_T("Error reading GIF"));
55 ok
= decod
->ConvertToImage(image
);
61 bool wxGIFHandler::SaveFile( wxImage
* WXUNUSED(image
),
62 wxOutputStream
& WXUNUSED(stream
), bool verbose
)
64 if (verbose
) wxLogDebug(_T("wxGIFHandler is read-only!!"));
68 bool wxGIFHandler::CanRead( wxInputStream
& stream
)
73 decod
= new wxGIFDecoder(&stream
);
74 ok
= decod
->CanRead();