If I have a transformation matrix, as a CGAffineTransform
, and a point, as a CGPoint
, how can I get the matrix-vector product?
For those wondering why I'm asking, I'm looking for a way to transform points between user coordinates and device coordinates. The functions CGContextConvertPointToUserSpace
and CGContextConvertPointToDeviceSpace
only seem to work in drawRect
. I want to be able to get touch input, coming from a gesture recognizer in device coordinates, and transform it to user coordinates using the saved transformation matrix (CGContextGetCTM
).
The function CGPointApplyAffineTransform()
seems to do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With