2011-05-11 45 views
4

我有一個對象QPixmap,如何讓他的反射沒有QImage? 現在我做到這一點使用的QImage(PyQt4的):反映QPixmap

tmp_image = QImage("./templates/{type}/{name}.png".format(type=tpl_type, name=tpl_name)) 
pixmap_reflect = QPixmap().fromImage(tmp_image.mirrored(horizontal=True, vertical=False)) 

回答

5

您應該能夠使用的QPixmap的transformed()see this),使用比例爲改造(一(1刻度,-1)應該做的伎倆我認爲)。我假設所有的功能都可以在PyQt中使用。不要自己使用它。

+1

謝謝,工作'pixmap_reflect = pixmap.transformed(QTransform()。scale(-1,1))' – ingenium 2011-05-11 08:09:35