def _set_image(self, v): if v != self._count: self._count = v if v in self._images: pix = self._images[v] else: reader = QImageReader(self._path) c = v % self._column_cnt r = v / self._column_cnt w, h = 22, 22 reader.setClipRect(QRect(c * w, r * h, w, h)) pix = QPixmap() pix.convertFromImage(reader.read()) self._images[v] = pix self.label.setPixmap(pix)
def GetPixelMapFromImage(image): """ Returns a QPixMap of the QImage given """ image_pixmap = QPixmap() image_pixmap.convertFromImage(image) return image_pixmap
def GetPixelMapFromImage(image): """ Returns a QPixMap of the QImage given """ image_pixmap = QPixmap() image_pixmap.convertFromImage(image) return image_pixmap