Ejemplo n.º 1
0
 def load_pixmaps(self, mask: qtg.QPixmap, image: qtg.QPixmap):
     self.top_container.load_pixmap(mask)
     self.backdrop_container.load_pixmap(image)
     self._max_pixmap_dimension = max(mask.width(), mask.height())
     self._last_midpoint = qtc.QPoint(
         self.horizontalScrollBar().value() + self.width() / 2,
         self.verticalScrollBar().value() + self.height() / 2)
Ejemplo n.º 2
0
    def set_background(self,
                       pixmap: QPixmap,
                       use_picture_coordinates: bool = True):

        if use_picture_coordinates:
            self.x_range = pixmap.width()
            self.y_range = pixmap.height()
            self.zoom_reset()
        self.background.set_picture(pixmap)
Ejemplo n.º 3
0
    def load_pixmap(self, pixmap: qtg.QPixmap):
        self._output_changed = False
        self.setPixmap(pixmap)
        self._master_pixmap = qtg.QPixmap(pixmap)
        self._original_pixmap = qtg.QPixmap(pixmap)

        if self._max_pixmap_dimension == None:
            self._max_pixmap_dimension = max(pixmap.width(), pixmap.height())
        self.update_pixmap()
Ejemplo n.º 4
0
    def initUI(self) -> None:
        self.setGeometry(0, 0, self.width, self.height)
        self.setWindowTitle('Message box')

        label = QLabel(self)
        pixmap = QPixmap(self.file_name)
        label.setPixmap(pixmap)
        self.resize(pixmap.width(),pixmap.height())

        self.show()