Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 视口的屏幕截图对于亚洲字符的文本质量较差_Python 2.7_Screenshot_Python Imaging Library_Viewport - Fatal编程技术网

Python 2.7 视口的屏幕截图对于亚洲字符的文本质量较差

Python 2.7 视口的屏幕截图对于亚洲字符的文本质量较差,python-2.7,screenshot,python-imaging-library,viewport,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

我的截图代码:

    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
这是一个截图。一般来说,图像有很多瑕疵。我怎样才能得到最好的质量?我不在乎文件大小