【发布时间】:2015-05-06 06:12:56
【问题描述】:
我在缩放和转换 QGraphicsPixmapItem 时遇到问题。我创建了图形编辑器,其中我使用初始大小为 100,100 的 QGraphicsItem,之后我通过 setTransform() 方法调整和旋转它。
之后,我存储此转换并将其用于我的另一个名为 player 的应用程序,我在其中使用这些转换并在其上显示图像和视频,如果我设置缩放和@,我现在使用 QgraphicsPixmapItem 显示图像987654325@ 图像清晰度的方法被破坏了。
是否可以保持清晰,即使我缩放和转换它。我使用的图像是 2560x1440 像素。 任何帮助将不胜感激。
代码是:
QGraphicsPixmapItem *pixitem = new QGraphicsPixmapItem;
pixitem->setFlags(QGraphicsItem::ItemIsMovable);
pixitem->setPos(50,50);
QTransform trans;
trans.setMatrix(4.20399,2.9286,0,-3.86601,0.761397,0,33.1015,-134.5,1);
pixitem->setPixmap(QPixmap("abc.jpg").scaled(100,100));
pixitem->setTransform(trans);
pixitem->setShapeMode(QGraphicsPixmapItem::MaskShape);
scene->addItem(pixitem);
【问题讨论】:
标签: c++ qt transformation image-quality qgraphicspixmapitem