View Full Version : how to rotate an image...
sh123
15th January 2009, 12:10
I want to know how to rotate an image.I have searched the forum but could find what i want.please help.
xenofanes
15th January 2009, 14:13
You can use QGraphicsPixmapItem. QGraphicsItem has rotate(angle) method.
This piece of code can be usefull.
QGraphicsScene *scene = new QGraphicsScene();
QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(QPixmap("image.bmp"));
scene->addItem(pixmapItem);
...
pixmapItem->rotate(15);
And read the qassistant for further need...
caduel
15th January 2009, 14:59
vague question... vague answer...
you can create a QMatrix (or a QTransform) for your rotation angle and then rotate your image (assuming you have a QImage) with QImage::transformed()
HTH
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.