Exemplo n.º 1
0
 def proper_display(window: FullscreenWindow):
     mat = Matrix(window.staticZoom, window.staticZoom)
     page_pix = return_page(window.file, window.currentPage).getPixmap(
         matrix=mat, alpha=False)
     fmt = QImage.Format_RGBA8888 if page_pix.alpha else QImage.Format_RGB888
     qt_img = QImage(page_pix.samples, page_pix.width, page_pix.height, page_pix.stride, fmt)
     if window.invertImage:
         qt_img.invertPixels(QImage.InvertRgba)
     pixmap = QPixmap(QPixmap.fromImage(qt_img))
     window.mainLabel.setPixmap(pixmap)
 def proper_display(window: ReaderWindowInteractivity):
     mat = Matrix(window.static_zoom, window.static_zoom)
     page_pix = return_page(window.file,
                            window.current_page).getPixmap(matrix=mat,
                                                           alpha=False)
     fmt = QImage.Format_RGBA8888 if page_pix.alpha else QImage.Format_RGB888
     qt_img = QImage(page_pix.samples, page_pix.width, page_pix.height,
                     page_pix.stride, fmt)
     if window.invert_image:
         qt_img.invertPixels(QImage.InvertRgba)
     pixmap = QPixmap(QPixmap.fromImage(qt_img))
     window.content.setPixmap(pixmap)
Exemplo n.º 3
0
 def zoom_out(self, window: FullscreenWindow):
     if self.currentMatrixZoom > self.minMatrixZoom:
         self.currentMatrixZoom -= 0.1
         page_pix = return_page(window.file, window.currentPage).getPixmap(
             matrix=Matrix(self.currentMatrixZoom, self.currentMatrixZoom))
         fmt = QImage.Format_RGBA8888 if page_pix.alpha else QImage.Format_RGB888
         qt_img = QImage(page_pix.samples, page_pix.width, page_pix.height, page_pix.stride, fmt)
         if window.invertImage:
             qt_img.invertPixels(QImage.InvertRgba)
         pixmap = QPixmap(QPixmap.fromImage(qt_img))
         window.mainLabel.setPixmap(pixmap)
         window.staticZoom = self.currentMatrixZoom
 def zoom_out(self, window: ReaderWindowInteractivity):
     if self.currentMatrixZoom > self.minMatrixZoom:
         self.currentMatrixZoom -= 0.25
         page_pix = return_page(window.file, window.current_page).getPixmap(
             matrix=Matrix(self.currentMatrixZoom, self.currentMatrixZoom))
         fmt = QImage.Format_RGBA8888 if page_pix.alpha else QImage.Format_RGB888
         qt_img = QImage(page_pix.samples, page_pix.width, page_pix.height,
                         page_pix.stride, fmt)
         if window.invert_image:
             qt_img.invertPixels(QImage.InvertRgba)
         pixmap = QPixmap(QPixmap.fromImage(qt_img))
         window.content.setPixmap(pixmap)
         window.static_zoom = self.currentMatrixZoom