I can't understand why when m_backgoundTransparency is 255 area which supposed to be transparent becomes black. As I Alpha is 255 means totally transparent?
QPixmap tempPixmap
(m_backroundPixmap
->size
());
tempPixmap.fill(Qt::transparent);
p.
setCompositionMode(QPainter::CompositionMode_Source);
p.drawPixmap(0,0,*m_backroundPixmap);
p.
setCompositionMode(QPainter::CompositionMode_DestinationIn);
p.
fillRect(tempPixmap.
rect(),
QColor(0,
0,
0,m_backgoundTransparency
));
p.end();
/* */
*m_backroundPixmap = tempPixmap;
QPixmap tempPixmap(m_backroundPixmap->size());
tempPixmap.fill(Qt::transparent);
QPainter p(&tempPixmap);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.drawPixmap(0,0,*m_backroundPixmap);
p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
p.fillRect(tempPixmap.rect(),QColor(0,0,0,m_backgoundTransparency));
p.end();
/* */
*m_backroundPixmap = tempPixmap;
To copy to clipboard, switch view to plain text mode
Bookmarks