C++ (Qt)void QPainter::setOpacity ( qreal opacity )
C++ (Qt)QPixmap sourcePixmap; QPixmap transparent(sourcePixmap.size());transparent.fill(Qt::transparent);QPainter p(&transparent);p.setOpacity(0.5);p.drawPixmap(0, 0, sourcePixmap);p.end(); sourcePixmap = transparent;