# show image
painter.drawPixmap(0, 0, self.__display)
# draw image
self.painter.begin(self.__transparent)
radialGrad.
setColorAt(0,
QColor(255,
0,
255,
255)) radialGrad.
setColorAt(1,
QColor(255,
0,
255,
0)) self.painter.setBrush(brush)
self.painter.setPen(Qt.NoPen)
self.painter.drawEllipse(self.pos, 50, 50)
self.painter.end()
self.painter.begin(self.__display)
if self.__painterMode is 0: # Draw color on image
self.painter.drawImage(0, 0, self.__image)
self.
painter.
setCompositionMode(QPainter.
CompositionMode_SourceAtop) self.painter.drawImage(0, 0, self.__transparent)
elif self.__painterMode is 1: # Draw alpha on image
self.painter.drawImage(0, 0, self.__image)
self.
painter.
setCompositionMode(QPainter.
CompositionMode_DestinationOut) self.painter.drawImage(0, 0, self.__transparent)
self.painter.end()
self.update()
# show image
painter.drawPixmap(0, 0, self.__display)
# draw image
self.painter = QPainter()
self.painter.begin(self.__transparent)
radialGrad = QRadialGradient(self.pos, 50)
radialGrad.setColorAt(0, QColor(255, 0, 255, 255))
radialGrad.setColorAt(1, QColor(255, 0, 255, 0))
brush = QBrush(radialGrad)
self.painter.setBrush(brush)
self.painter.setPen(Qt.NoPen)
self.painter.drawEllipse(self.pos, 50, 50)
self.painter.end()
self.painter.begin(self.__display)
if self.__painterMode is 0: # Draw color on image
self.painter.drawImage(0, 0, self.__image)
self.painter.setCompositionMode(QPainter.CompositionMode_SourceAtop)
self.painter.drawImage(0, 0, self.__transparent)
elif self.__painterMode is 1: # Draw alpha on image
self.painter.drawImage(0, 0, self.__image)
self.painter.setCompositionMode(QPainter.CompositionMode_DestinationOut)
self.painter.drawImage(0, 0, self.__transparent)
self.painter.end()
self.update()
To copy to clipboard, switch view to plain text mode
Bookmarks