ingenium
ingenium

Reputation: 63

Reflect the QPixmap

I have an object QPixmap, how to get his reflection without QImage? Now I do it using QImage (PyQt4):

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

Upvotes: 6

Views: 5390

Answers (1)

Bart
Bart

Reputation: 20028

You should be able to use QPixmap's transformed() (see this), using a scale as the transform (a scale of (1,-1) should do the trick I think). I'm assuming all functionality is available in PyQt. Don't use that myself.

Upvotes: 13

Related Questions