From: "Petric Frank" <pfr...@gmx.de>
To: "interest@qt-project.org" <interest@qt-project.org>
Subject: [Interest] QGraphicsScene and writing to file
Hello,
i have a QGraphicsScenewhich i want to write to a file (*.png, ...).
As documrmtation states i use the following:
------------------- cut ---------------------------
QGraphicsScene scene; // previously filled
QRectF rect = scene->sceneRect ();
QImage img (rect.width () + 1, rect.height () + 1, QImage::Format_ARGB32);img.fill (QColor (Qt::white).rgb ());
QPainter p (&img);
scene->render (&p);
p.end ();
img.save ("pict.png");
------------------- cut ---------------------------
But this does not work for bigger pictures. No error message. The viewer simply tells that the generated *.png file are corrupted.
The scenes reqire a width of about 100000 pixels.
After some searching in the web i found out the QImage (and QPixmap) seems to have an internal limitation of about 32k x 32k.
The PNG-format does not have such a limitation.
Any hints on how to export such a big scene to a PNG (or other) file ?
Currently i use Qt 5.6.1 (Linux 64 Bit) and Qt 5.2 (Windows 7 64 Bit).
Both hosts have 16 GB main memory.
kind regards
Petric
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest