How to rotate a Pixmap around bottom, right corner?
Solved
General and Desktop
-
Hi guys,
This code is not working. The origin is not changing trought the member called by inheritance.
The rotation matrix is ok.The image is 88x63 pixels.
What i´m missing?
How to change anchor point of a pixmap rotation?
QPixmap rpm(":/assets/assets/RPM_POINTER.png"); QGraphicsPixmapItem rpmgauge(rpm); rpmgauge.setTransformOriginPoint(88,-63); QTransform rm; rm.rotate(45); rpm = rpmgauge.pixmap(); graphic->addPixmap(rpm.transformed(rm)); ui->graphicView->setScene(graphic);
Thank you
-
@michelmadeira said in How to rotate a Pixmap around bottom, right corner?:
How to change anchor point of a pixmap rotation?
By modifying your QTransform to set 0/0 to the bottom right corner because the Qt coordinate system starts with 0/0 in the upper left.