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