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());
graph_pixmap_ 的type是 QGraphicsPixmapItem
graph_scene_ 的type是 QGraphicsScene
graph_view_ 的type是 QGraphicsView
我把image的像素以90度的倍数旋转,旋转後有时候会造成图片的一部分被截掉
请问我该怎麽解决这个问题?我本想使用QGraphicsItem的rotation来解决,
但是我需要储存的是实际被旋转过後的图片,所以最後还是自己动手把图片转过来