开发者

Antialiasing PNG resize in Qt?

开发者 https://www.devze.com 2023-04-10 15:37 出处:网络
In a PyQt based GUI program, I\'m drawing a few PNG file as QPixmap after resize. So here is basically what happens:

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)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号