I'm trying to skew the rectangle, so the two vertical sides are tilted but parallel, and the top and bottom are horizontal.
I try to use CGAffineTransform and found this code, but I do not understand what to put in different parts.
imageView.layer.somethingMagic.imageRightTop = (CGPoint){ 230, 30 }; imageView.layer.somethingMagic.imageRightBottom = (CGPoint){ 300, 150 }; #define CGAffineTransformDistort(t, x, y) (CGAffineTransformConcat(t, CGAffineTransformMake(1, y, x, 1, 0, 0))) #define CGAffineTransformMakeDistort(x, y) (CGAffineTransformDistort(CGAffineTransformIdentity, x, y))
although it is said to be easy, I donβt know what to put in different places.
I assume that the image image will be my image, which I want to change, but what happens in somethingMagic. and imageRightTop and imageRightBottom.
Also how to determine t.
If there is a more detailed explanation, I would be grateful, since in most cases I found only this as an explanation of what needs to be done to skew the rectangle.
thanks
source share