AsAndrew
7th October 2010, 08:18
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);
QPainter p(&tempPixmap);
p.setCompositionMode(QPainter::CompositionMode_Sou rce);
p.drawPixmap(0,0,*m_backroundPixmap);
p.setCompositionMode(QPainter::CompositionMode_Des tinationIn);
p.fillRect(tempPixmap.rect(),QColor(0,0,0,m_backgo undTransparency));
p.end();
/* */
*m_backroundPixmap = tempPixmap;
QPixmap tempPixmap(m_backroundPixmap->size());
tempPixmap.fill(Qt::transparent);
QPainter p(&tempPixmap);
p.setCompositionMode(QPainter::CompositionMode_Sou rce);
p.drawPixmap(0,0,*m_backroundPixmap);
p.setCompositionMode(QPainter::CompositionMode_Des tinationIn);
p.fillRect(tempPixmap.rect(),QColor(0,0,0,m_backgo undTransparency));
p.end();
/* */
*m_backroundPixmap = tempPixmap;