Exemplo n.º 1
0
 def imshow(self, image=None):
     if image is None:
         image = img_pack["nofile"]
         self._photo.setPixmap(pil2qt(image))
     else:
         try:
             self._photo.setPixmap(pil2qt(image))
         except:
             image = img_pack["nofile"]
             self._photo.setPixmap(pil2qt(image))
     self._empty = False
     self.fitInView()
Exemplo n.º 2
0
 def imshow(self, image=None):
     if image is None:
         image = img_pack["nofile"]
         self._photo.setPixmap(pil2qt(image))
         self.setDragMode(QtWidgets.QGraphicsView.NoDrag)
     else:
         try:
             self._photo.setPixmap(pil2qt(image))
             self.img_cache = image.copy()
             self.setDragMode(QtWidgets.QGraphicsView.ScrollHandDrag)
         except:
             image = img_pack["nofile"]
             self._photo.setPixmap(pil2qt(image))
             self.setDragMode(QtWidgets.QGraphicsView.NoDrag)
     self._empty = False
     if not self.oldSize == self.img_cache.size:
         self.fitInView()
         self.oldSize = self.img_cache.size