[PyQt] "Image view" problem
Enis Karaarslan
enis.karaarslan at ege.edu.tr
Thu Feb 28 12:54:59 GMT 2008
Hello all,
I want to show a graph (png file) about network traffic usage in my pyQt
application. The following works, but I want to put the picture in the main
window.
image = Image.open ('ragraph.png')
image.show()
A simple question I guess, but as a newbie - I couldn't suceed.
I put a graphicsView object but I couldn't write to it.
self.image = QtGui.QImage()
self.image.load(QtCore.QString("ragraph.png"))
self.image=self.image.scaledToWidth(self.image.width()/2)
#self.image=self.image.scaled (QSize(321, 271) )
scene = QtGui.QGraphicsScene()
self.item = self.image
scene.addItem(self.item)
scene.setSceneRect(-600, -600, 1200, 1200)
self.graphicsView.show();
I couldn't additem to the QGraphicsScene object
I suppose I am in a wrong direction. Any recommendations will be appreciated.
Thanks,
--
--------------------------------------------
* Ar.Gör.Enis Karaarslan
*
* ULAK-CSIRT - http://csirt.ulakbim.gov.tr
--------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080228/3097d88e/attachment.bin
More information about the PyQt
mailing list