I am working on image transformation,I want to scale and rotate image at the same time from x origin and y origin. I tried to use separate Scale,Rotate but they work one at the same time. here is my code
function setRotation(rotation){
rt.origin.x=imagQuickitem.anchorPoint.x;
rt.origin.y=imagQuickitem.anchorPoint.y;
rt.angle=rotation
image.transform=rt;
image.transform=sc;
}
function setScale(scale){
sc.origin.x=imagQuickitem.anchorPoint.x;
sc.origin.y=imagQuickitem.anchorPoint.y;
sc.xScale=scale;
sc.yScale=scale;
image.transform=sc;
}
Scale { id:sc; }
Rotation { id:rt; }
Well, It seems the solution is QMatrix4x4,I tried to use QMatrix4x4 and found this link Qt Transform matrix but I have no idea how to write matrix to work for both scale and rotation, should I multiple scale matrix with rotation matrix?