【问题标题】:CGContextShowTextAtPoint how to write text in horizontal from bottom to top?CGContextShowTextAtPoint 如何从下到上水平书写文本?
【发布时间】:2012-05-17 19:09:05
【问题描述】:

我想在CGContext中从下到上水平写一个文本?我做了以下。

 CGContextSelectFont(cgContext, "Arial", 8, kCGEncodingMacRoman);
 CGContextSetTextMatrix(cgContext, CGAffineTransformMakeRotation  (M_PI /2));
 CGContextShowTextAtPoint(cgContext, xval, yval, "transd", 6);

文本是水平的,但它显示的文本是反向的。如何解决这个问题?

【问题讨论】:

    标签: ios4 ios5 core-graphics


    【解决方案1】:

    CGContextSetTextMatrix(cgContext, CGAffineTransformMake(1, 0, 0, -1, 0, 0));

    代替:

    CGContextSetTextMatrix(cgContext, CGAffineTransformMakeRotation (M_PI /2));

    对我有用,希望对你有用

    【讨论】:

      猜你喜欢
      • 2018-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-22
      • 2020-10-13
      • 1970-01-01
      • 2011-07-19
      • 2012-02-17
      相关资源
      最近更新 更多