PDA

View Full Version : problem on Linux while drawing on QPixmap with CompositionMode_Clear



sanjayshelke
8th May 2009, 13:37
Hi all again,

This issue is related to same application mentioned in the last post.
But again i will mention here. I am developing small application that can Zoom and erase the image.

All functionalities are working fine except erase on Ubuntu platform.

When i am erasing the image its not erased but painted with black color.

i have written code like this :

QPainter painter(&imgPixmap); //imgPixmap is QPixmap
painter.setCompositionMode(QPainter::CompositionMo de_Clear);
QPen pen;
pen.setCapStyle(Qt::RoundCap);
pen.setWidth(m_nEraserSize);
painter.setPen(pen);
painter.drawPoint(ptPos);
painter.end();

This part of code is working fine on windows and Mac OS X.

If i convert the QPixmap into QImage with the format QImage::Format_ARGB32 and then drawing on QImage works fine.

But converting QPixmap to QImage takes time and slows down the performance.

Any solution to this.


regards,
~Sanjay