Skip to content

Instantly share code, notes, and snippets.

@yusukei
Created May 25, 2012 03:47
Show Gist options
  • Save yusukei/2785641 to your computer and use it in GitHub Desktop.
Save yusukei/2785641 to your computer and use it in GitHub Desktop.
class ImgWidget(QtGui.QWidget):
def __init__(self, imagePath, x=None, y=None, parent=None):
super(ImgWidget, self).__init__(parent)
self.pic = QtGui.QPixmap(imagePath)
self.x = x
self.y = y
def paintEvent(self, event):
painter = QtGui.QPainter(self)
x = 0
y = 0
painter.drawPixmap(x, y, self.pic)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment