diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-08-14 14:49:07 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-08-14 14:49:07 (GMT) |
commit | 9e6be9a8ae24b788cf2463a703bda48cbd77c773 (patch) | |
tree | fed426d0d7216311cbd009a1fcd2786176478b5e /src/image.cpp | |
parent | 6e28050ef5483e624122b0bacb998c40664f78ee (diff) | |
download | Doxygen-9e6be9a8ae24b788cf2463a703bda48cbd77c773.zip Doxygen-9e6be9a8ae24b788cf2463a703bda48cbd77c773.tar.gz Doxygen-9e6be9a8ae24b788cf2463a703bda48cbd77c773.tar.bz2 |
Release-1.5.9-20090814
Diffstat (limited to 'src/image.cpp')
-rw-r--r-- | src/image.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/image.cpp b/src/image.cpp index c2d79d5..e290e1b 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -18,8 +18,8 @@ #include "qtbc.h" #include "image.h" -#include "pngenc.h" -#include <qglobal.h> +#include "gifenc.h" +#include <qfile.h> const int charSetWidth=80; const int charHeight=12; @@ -321,11 +321,20 @@ void Image::fillRect(int x,int y,int lwidth,int lheight,uchar colIndex,uint mask bool Image::save(const char *fileName,int mode) { - PngEncoder enc(data, - mode==0 ? palette : palette2, - width,height, - mode==0 ? 3 : 4, - 0); - enc.write(fileName); - return TRUE; + GifEncoder gifenc(data, + mode==0 ? palette : palette2, + width,height, + mode==0 ? 3 : 4, + 0); + QFile file(fileName); + if (file.open(IO_WriteOnly)) + { + gifenc.writeGIF(file); + return TRUE; + } + else + { + return FALSE; + } } + |