timmu
8th December 2009, 16:55
I know how to save a QPixmap (map) as a bitmap:
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:
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?:
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qtiff)
Thanks so much!
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:
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?:
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qtiff)
Thanks so much!