ios 绘图笔记--CGContextTranslateCTM
2011-07-26 14:05
766 查看
我们在使用“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(ctx, 0, imageSize.height);
CGContextScaleCTM(ctx, 1, -1);
解决。
不过要是想继续正常绘制其他内容,我们可以采用先存储后恢复的方式
CGAffineTransform normalState=CGContextGetCTM(context);
CGContextTranslateCTM(ctx, 0, imageSize.height);
CGContextScaleCTM(ctx, 1, -1);
CGContextConcatCTM(context, normalState);
相关文章推荐
- ios学习临时笔记-CGContext学习
- IOS开发之—绘图 CGContext
- iOS绘图系列四:绘制文字和图像CGContextDrawImage,drawInRect:,drawAtPoint:, UIGraphicsBeginImageContext
- ios绘图系列五:绘制渐变CGContextDrawLinearGradient, CGContextDrawRadialGradient, CAGradientLayer
- iOS绘图系列二:画直线 CGContextMoveToPoint,CGContextAddLineToPoint,CGContextAddLines,
- iOS绘图系列三:画弧线CGContextAddArc ,CGContextAddArcToPoint,CGContextAddCurveToPoint,UIBezierPath
- iOS绘图系列二:画直线 CGContextMoveToPoint,CGContextAddLineToPoint,CGContextAddLines,
- iOS--坐标变换Quartz 2D中的CGContextTranslateCTM、CGContextScaleCTM、
- iOS - CGContextAddLineToPoint 绘图崩溃:
- iOS--坐标变换Quartz 2D中的CGContextTranslateCTM、CGContextScaleCTM、CGContextRotateCTM、CGContextConcatCTM等
- [iOS] 绘图 CGContext 用法
- iOS绘图系列四:绘制文字和图像CGContextDrawImage,drawInRect:,drawAtPoint:, UIGraphicsBeginImageContext
- iOS开发 : 坐标变换Quartz 2D中的CGContextTranslateCTM、CGContextScaleCTM
- CoreGraphics之CGContext绘图 - iOS开发
- iOS中CG绘图笔记
- ios绘图系列五:绘制渐变CGContextDrawLinearGradient, CGContextDrawRadialGradient, CAGradientLayer
- iOS--坐标变换Quartz 2D中的CGContextTranslateCTM、CGContextScaleCTM、CGContextRotateCTM、CGContextConcatCTM等
- CGContext绘图
- iOS底层绘图机制,CoreGraphics框架,和Context使用详解
- [iOS] 绘制虚线CGContextSetLineDash的使用