[...]
i1
= QtGui.
QPixmap('qtg_aircraft.png') i2
= QtGui.
QPixmap('qtg_locked.png')
alpha.fill(QtCore.Qt.transparent)
brush
= QtGui.
QBrush(QtCore.
Qt.
SolidPattern) brush.
setColor(QtGui.
QColor(QtCore.
Qt.
transparent))
painter.setBrush(brush)
painter.
drawPixmap(QtCore.
QRect(0,
0,
24,
24),
alpha,
QtCore.
QRect(0,
0,
24,
24))
painter.
drawImage(QtCore.
QRect(0,
0,
24,
24),
i1.toImage(),
QtCore.
QRect(0,
0,
24,
24))[...]
[...]
i1 = QtGui.QPixmap('qtg_aircraft.png')
i2 = QtGui.QPixmap('qtg_locked.png')
alpha = QtGui.QPixmap(QtCore.QSize(24, 24))
alpha.fill(QtCore.Qt.transparent)
result = QtGui.QPixmap(QtCore.QSize(24, 24))
painter = QtGui.QPainter(result)
brush = QtGui.QBrush(QtCore.Qt.SolidPattern)
brush.setColor(QtGui.QColor(QtCore.Qt.transparent))
painter.setBrush(brush)
painter.drawPixmap(QtCore.QRect(0, 0, 24, 24),
alpha,
QtCore.QRect(0, 0, 24, 24))
painter.drawImage(QtCore.QRect(0, 0, 24, 24),
i1.toImage(),
QtCore.QRect(0, 0, 24, 24))
[...]
To copy to clipboard, switch view to plain text mode
Bookmarks