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:
QRectF rect
= scene
->itemsBoundingRect
();
painter->begin(image);
scene->render(painter);
painter->end();
image->save("test.jpg", "JPG");
delete painter;
delete 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;
To copy to clipboard, switch view to plain text mode
What am I doing wrong?
Thanks for your support.
Bookmarks