我们在使用“CGContextShowTextAtPoint”,经常会遇到字体翻转问题。CGContextShowTextAtPoint word upside.
这个问题可以通过
CGContextTranslateCTM(ctx, 0, imageSize.height);
CGContextScaleCTM(ctx, 1, -1);
解决。
不过要是想继续正常绘制其他内容,我们可以采用先存储后恢复的方式
CGAffineTransform normalState=CGContextGetCTM(context);
CGContextTranslateCTM(ctx, 0, imageSize.height);
CGContextScaleCTM(ctx, 1, -1);
CGContextConcatCTM(context, normalState);
本文详细介绍了使用CGContextTranslateCTM、CGContextScaleCTM和CGContextConcatCTM来解决在使用CGContextShowTextAtPoint时遇到的字体翻转问题,并通过先存储后恢复CTM状态确保后续内容正常绘制。

5349

被折叠的 条评论
为什么被折叠?



