我在缩放和转换QGraphicsPixmapItem时遇到了问题。我已经创建了图形编辑器,在其中我使用的是初始大小为100,100的QGraphicsItem,在此之后,我将通过setTransform()方法对其进行调整和旋转。
在此之后,我将存储这个转换,并将其用于我的另一个名为player的应用程序,在该应用程序中,我使用这些转换并在其上显示图像和视频,如果我设置了缩放和setTransform方法来显示其清晰度,我将使用setTransform来显示图像。
如果我用2560x1440像素缩放和变换it.The图像,是否可以保持清晰。任何帮助都将不胜感激。
守则是:
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);发布于 2015-05-06 06:46:09
可以使用setTransformationMode函数设置像素映射项的转换模式。默认值是Qt::FastTransformation。您应该将转换模式设置为Qt::SmoothTransformation,以启用双线性过滤,这将在缩放时获得更好的质量:
pixitem->setTransformationMode(Qt::SmoothTransformation);https://stackoverflow.com/questions/30068886
复制相似问题