how to save pixmap as GIF
I know how to save a QPixmap (map) as a bitmap:
Code:
map.save("image.bmp", 0, -1);
The above won't work for the *.gif image format because I need plugins for the image formats other than bitmap. I got this to work when I was linking statically with another program but now I'm linking dynamically. I think I need to modify my *.pro file and main.cpp somehow. I'm not sure how to do that. This is what I have so far:
My *.pro file:
Code:
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += plugin
QTPLUGIN += qjpeg \
qgif \
qtiff
# Input
HEADERS += binary.h
SOURCES += functions.cpp \
main.cpp
I wonder if I need these at the beginning of my main.cpp or is this something you only use for static linking?:
Code:
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qtiff)
Thanks so much!
Re: how to save pixmap as GIF
you can load gifs using QMovie, but I don't see any method which allows to save into gif-format file.
Re: how to save pixmap as GIF
I'm a little bit confused. I'm pretty sure I've seen people turn pixmaps into gif files with Qt but I just cannot figure out how or find the instructions.
Re: how to save pixmap as GIF
as Qt Assistant says, Qt can only read gifs
Quote:
Format Description Qt's support
GIF Graphic Interchange Format (optional) Read
take a look docs about QPixmap.
Re: how to save pixmap as GIF
Thanks, but what about writing JPEGs. I need to write very large image files and the reason BMP won't work is because the file size is huge. I could also use JPEG. Do you know if writing JPEG is possible and what plugins are needed?
Re: how to save pixmap as GIF
Quote:
BMP Windows Bitmap Read/write
GIF Graphic Interchange Format (optional) Read
JPG Joint Photographic Experts Group Read/write
JPEG Joint Photographic Experts Group Read/write
PNG Portable Network Graphics Read/write
PBM Portable Bitmap Read
PGM Portable Graymap Read
PPM Portable Pixmap Read/write
XBM X11 Bitmap Read/write
XPM X11 Pixmap Read/write
this means that you can write JPG.