Qt旋转图片,图片会变形.是怎么回事.
我用这样的方法对一张图片进行旋转,结果图片变形了..下面提代码:
QTransform trans;
QImage newimg;
if (ang >= lastValue){
//pixmapItem->setRotation((ang - 50) *ROTATE_STEP);
trans = trans.rotate(ROTATE_STEP);
newimg = img.transformed(trans);
}else{
//pixmapItem->setRotation(-(50 - ang) * (ROTATE_STEP));//反向旋转
trans = trans.rotate(-(ROTATE_STEP));
newimg = img.transformed(trans);
}
[解决办法]