Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Solved]QPixmap being clipped after rotation



  • @

    QImage img("lena.jpg");

    rotate_image_implace(img, angle); //rotate the img with angle degrees
    graph_pixmap_->setPixmap(QPixmap::fromImage(img));
    graph_scene_->setSceneRect(img.rect());

    @

    type of graph_pixmap_ is QGraphicsPixmapItem
    type of graph_scene_ is QGraphicsScene

    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.



  • After struggling of several hours, I find out that my scaling methods has some bugs, sorry to
    bother you all.


Log in to reply