[PyKDE] How to add a bmp,gif,png or jpg onto a canvas
Holmquist, Neil
Neil.Holmquist at SpirentCom.COM
Wed May 9 01:24:08 BST 2001
I figured it out...this does the trick:
class Image(QCanvasRectangle):
def __init__(self,canvas):
QCanvasRectangle.__init__(self,20,20,32,32,canvas)
self.pixmap = QPixmap('router.bmp')
def drawShape(self,painter):
painter.drawPixmap( 20, 20, self.pixmap );
...
item = Image(canvas)
item.show()
...
-----Original Message-----
From: Holmquist, Neil [mailto:Neil.Holmquist at spirentcom.com]
Sent: Tuesday, May 08, 2001 9:15 AM
To: pykde at mats.gmd.de
Subject: [PyKDE] How to add a bmp,gif,png or jpg onto a canvas
I'm having the darndest time trying to add a graphic image onto a canvas.
Does anyone have an example or can explain how to do this.
Thanks.
_______________________________________________
PyKDE mailing list PyKDE at mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
More information about the PyQt
mailing list