Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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))
like image 240
ingenium Avatar asked May 11 '11 07:05

ingenium


1 Answers

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.

like image 113
Bart Avatar answered Oct 04 '22 03:10

Bart