ios – 如何镜像UIBezierPath?

ios – 如何镜像UIBezierPath?,第1张

概述我有一个UIBezierPath,我想得到它的镜像.我该如何做到这一点? // Method for generating a path UIBezierPath *myPath = [self generateAPathInBounds:boundingRect]; // ? now I would like to mirror myPath ? // Method for generat 我有一个UIBezIErPath,我想得到它的镜像.我该如何做到这一点?
// Method for generating a path UIBezIErPath *myPath = [self generateAPathInBounds:boundingRect]; // ? Now I would like to mirror myPath ?
解决方法
// Method for generating a pathUIBezIErPath *myPath = [self generateAPathInBounds:boundingRect];// Create two transforms,one to mirror across the x axis,and one to// to translate the resulting path back into the desired boundingRectCGAffinetransform mirrorOverXOrigin = CGAffinetransformMakeScale(-1.0f,1.0f);CGAffinetransform translate = CGAffinetransformMakeTranslation(boundingRect.wIDth,0);// Apply these transforms to the path[myPath applytransform:mirrorOverXOrigin];[myPath applytransform:translate];
总结

以上是内存溢出为你收集整理的ios – 如何镜像UIBezierPath?全部内容,希望文章能够帮你解决ios – 如何镜像UIBezierPath?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1097690.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存