In a PyQt based GUI program, I'm drawing a few PNG file as QPixmap after resize. So here is basically what happens:
bitmap = QPixmap( "foo.png" )
bitmap.scaleToHeight(38) # original is larger than this
scene.addItem(QGraphicsPixmapItem(bitmap)) # Add to graphics scene
The problem i开发者_StackOverflow社区s: afterwards, the bitmap is rather ugly. Is there a way to do this in a antialiasing way?
See the documentation.
bitmap = bitmap.scaledToHeight(38, Qt.SmoothTransformation)
精彩评论