[Qt-interest] Drawing rectangles with non-full opacity.
Bram Schoenmakers
lists at bramschoenmakers.nl
Fri Mar 6 11:53:01 CET 2009
Hello,
I have a problem with giving a QPixmap a soft border in Qt 4.4.x. The original
pixmap does not have an alpha channel, but I use the trick described at [1].
This involves creating a new pixmap of the same size and draw the original
pixmap on it.
Then, I draw a rectangle around the border, adjust the rectangle, decrease
opacity and draw a new rectangle. The latter happens with composition mode
DestinationIn.
This is causing problems. QPainter::drawRect() , but as soon as I draw
rectangles with a pen with non-full opacity I don't see the rectangle on
screen. What is going on and how should I fix this?
[1]
http://techbase.kde.org/Development/Tutorials/Graphics/Performance#The_right_way_to_do_it
Thanks in advance,
--
Bram Schoenmakers
What is mind? No matter. What is matter? Never mind.
(Punch, 1855)
More information about the Qt-interest-old
mailing list