[Interest] double-buffering, quality drop

Alexander Semke Alexander.Semke at web.de
Tue Feb 3 10:39:46 CET 2015


Am Dienstag, 3. Februar 2015, 10:18:10 schrieben Sie:
> Here I do not mean the image you attached to your first mail. I mean the
> QPixmap you create in Curve::updatePixmap(), which is the one that then
> gets scaled afterwards, which itself is the JPG you attached, or not? If
> the QPixmap of Curve::updatePixmap() is wrong the further processing can,
> of course, not improve it.
I understood you. I also meant the pixmap I saved in Curve::updatedPixmap() 
with pixmap.save("my_pix.png", "PNG"). This saved file also has bad quality. 
See the attached file. This was the very first thing that I tried out when I 
saw this quality drop... So, the quality drop is because of the painting on 
QPixmap here.
The jpegs I attached in my first mail were screenshots of the application.

> On the other hand, you can try to solve the issue pragmatically: if the
> drawing works correct if done directly in Curve::paint((QPainter* painter,
> const QStyleOptionGraphicsItem*, QWidget*) then you can create the QPixmap
> there (if an update is needed) and draw it or just draw it if no update is
> needed.
This is good idea. I'll try this today in the evening.

> The difference has to lie in the preparation (by Qt) of QPainter before
> Curve::paint is called.
Yes, I think so too. Now I just need to understand the difference between the 
QPainter passed to QGraphicsImem::paint() and the painter I localy create in 
Curve::updatePixmap(). On the other hand, what I'm doing in updatePixmap() is 
pretty much the standard way to draw on a QPixmap according to Qt's 
documentation. I don't believe this standard way without setting any 
"advanced" flags for QPainter leads to such a bad quality...

-- 
Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my_pix.png
Type: image/png
Size: 16007 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150203/44d7170f/attachment.png>


More information about the Interest mailing list