rotate_image_implace(img, angle); //rotate the img with angle degrees(90, 180, 270 and so on)
graph_pixmap_
->setPixmap
(QPixmap::fromImage(img
));
graph_scene_->setSceneRect(img.rect());
QImage img("lena.jpg");
rotate_image_implace(img, angle); //rotate the img with angle degrees(90, 180, 270 and so on)
graph_scene_ = new QGraphicsScene(this);
graph_scene_->addItem(graph_pixmap_ = new QGraphicsPixmapItem);
graph_view_ = new QGraphicsView(graph_scene_, this);
graph_pixmap_->setPixmap(QPixmap::fromImage(img));
graph_scene_->setSceneRect(img.rect());
To copy to clipboard, switch view to plain text mode
type of graph_pixmap_ is QGraphicsPixmapItem
type of graph_scene_ is QGraphicsScene
type of graph_view_ is QGraphicsView
This may clip the image if their height and width are different, how could I rotate the image without clipping it?
Because the program need to save the image after rotating and mirror(vertical and horizontal), rotation of QGraphicsPixmapItem is not adopted.
Bookmarks