CGContextTranslateCTM 画布的大小由 UIGraphicsBeginImageContextWithOptions 的参数 size 决定,老是记不住这一点。
UIGraphicsBeginImageContextWithOptions(size, YES, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context, 0, size.height);
CGContextScaleCTM(context, 1, -1);
本文详细解释了在iOS开发中如何通过UIGraphicsBeginImageContextWithOptions设置画布大小,并利用CGContextTranslateCTM与CGContextScaleCTM调整坐标系。了解这些操作对于优化UI绘制流程至关重要。

371

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



