def load_image(self, image):
"""
Call this to load a new image from the provide QImage into
this HomographyView's scene. The image's top left corner will
be placed at (0,0) in the scene.
"""
self.scene_image = image
new_scene = QtWidgets.QGraphicsScene(self)
pmap = QtGui.QPixmap().fromImage(image)
pmapitem = new_scene.addPixmap(pmap)
new_scene.setBackgroundBrush(QtGui.QBrush(QtGui.QColor(0, 0, 0)))
self.setScene(new_scene)
self.fitInView(0, 0, pmap.width(), pmap.height(), Qt.KeepAspectRatio)
self.show()
self.image_loaded = True
评论列表
文章目录