ios - 如何将 CGAffineTransform 应用于 CGPoint

标签 ios objective-c vector matrix core-graphics

如果我有一个转换矩阵,如 CGAffineTransform,和一个点,如 CGPoint,我如何获得矩阵向量积?

对于那些想知道我为什么要问的人,我正在寻找一种在用户坐标和设备坐标之间转换点的方法。 CGContextConvertPointToUserSpaceCGContextConvertPointToDeviceSpace 函数似乎只能在 drawRect 中使用。我希望能够从设备坐标中的手势识别器获取触摸输入,并使用保存的转换矩阵 (CGContextGetCTM) 将其转换为用户坐标。

最佳答案

函数CGPointApplyAffineTransform()似乎做你想做的事。

关于ios - 如何将 CGAffineTransform 应用于 CGPoint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22189533/

相关文章:

objective-c - 如何更改 UIPageViewController 分页 curl 动画的方向

ios - 由于未捕获的异常而终止应用程序。 "nil string parameter"

r - 将命名字符向量转换为 data.frame

C++,STL。从 vector<string> 中删除具体值?

ios - 代码/iOS : How to enable App Groups without Developer Account?

ios - 我可以使用 Ubuntu 创建 Apple iPod/iPhone/iPad 应用程序吗?

objective-c - 将 NSString 转换为 unsigned long long 的问题

iphone - 加载 UIImage 低质量

objective-c - Objective-C 类或结构?

c++ - 当请求的键丢失时,有没有办法从 vector 映射中返回 std::vector ref?