视口的屏幕截图具有较差的亚洲字符文本质量

时间:2016-02-27 09:13:48

标签: python-2.7 screenshot python-imaging-library viewport

我的截图代码:

    def savepng(self):
    fileName = QFileDialog.getSaveFileName(self.win, "Save Page", QDesktopServices.storageLocation(QDesktopServices.DesktopLocation), "Portable Network Graphics (*.png)")
    if fileName != "":
        mw.progress.start(immediate=True)
        if not ".png" in fileName:
            fileName += ".png"
        p = self.wv.page()
        oldsize = p.viewportSize()
        p.setViewportSize(p.mainFrame().contentsSize())
        image = QImage(p.viewportSize(), QImage.Format_ARGB32)
        painter = QPainter(image)
        p.mainFrame().render(painter)
        painter.end()
        image.save(fileName, "png", 100)
        p.setViewportSize(oldsize)
        mw.progress.finish()
        showInfo("Image saved to %s!" % os.path.abspath(fileName))
    return

Here是截图。通常,图像也有很多伪影。我如何获得最佳质量?我不在乎文件大小。

0 个答案:

没有答案