I am trying to skew a rectangle so the two vertical sides are slanted but parallel and the top and bottom are horizontal.
I am trying to use CGAffineTransform and have found this code but I am not figuring out what to put in the various 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 this is said to be easy I don't know what to put in the different places.
I assume image view would be my image that I want to change however what goes into somethingMagic. and imageRightTop and imageRightBottom.
Also how do I define t.
If there is a more thorough explanation I would appreciate it since in most cases I found only this as the explanation of what to do to skew a rectangle.
Thanks