[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Painting on the QImage in QPainter Canvas
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2009-08-15 7:23:48
Message-ID: ba035dd10908150023w68f3e555i87eed327050c9aab () mail ! gmail ! com
[Download RAW message or body]

> I haven't seen Krita code, but the usual way to overcome this problem
> is to have a persistent "scratch" QImage. Of course this QImage needs
> to grow and shrink (but not aggressively) according to the said
> updated rect.

I just saw the patch and it does exactly what I wrote above. A slight
improvement would be add some hysteresis to the size change detection
so no need to recreate m_buffer if e.g. the size goes from (100, 100)
to (99, 99).

One nitpicky point: after recreating m_buffer, it is better to fill it
with a color of your choice (you know better which color to pick),
otherwise, if the subsequent drawing does not paint every single
pixels, you may see some garbage on the screen.

And of course, all this extra indirection can be ignored if the raster
paint engine is already in use.



-- 
Ariya Hidayat, Qt, Nokia
http://www.linkedin.com/in/ariyahidayat
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic