27Loco
28th July 2010, 10:31
Hello,
I already added the plugins qgif4.dll, qjpeg4.dll and qtiff4.dll and called in the main method QApplication::addLibraryPath. The application now successfully loads images and tells me that the following formats are supported.
bmp, jpeg, jpg, png, ppm, tif, tiff, xbm, xpm
But saving works only on my development machine. This is what I am doing in order to save an image:
QPainter *painter = new QPainter();
QRectF rect = scene->itemsBoundingRect();
QImage *image = new QImage(rect.size().toSize(), QImage::Format_ARGB32_Premultiplied);
painter->begin(image);
scene->render(painter);
painter->end();
image->save("test.jpg", "JPG");
delete painter;
delete image;
What am I doing wrong?
Thanks for your support.
I already added the plugins qgif4.dll, qjpeg4.dll and qtiff4.dll and called in the main method QApplication::addLibraryPath. The application now successfully loads images and tells me that the following formats are supported.
bmp, jpeg, jpg, png, ppm, tif, tiff, xbm, xpm
But saving works only on my development machine. This is what I am doing in order to save an image:
QPainter *painter = new QPainter();
QRectF rect = scene->itemsBoundingRect();
QImage *image = new QImage(rect.size().toSize(), QImage::Format_ARGB32_Premultiplied);
painter->begin(image);
scene->render(painter);
painter->end();
image->save("test.jpg", "JPG");
delete painter;
delete image;
What am I doing wrong?
Thanks for your support.