CGContext 处理文字。

2011-04-02

在CGContext里处理文字信息

示例代码:

    CGContextSetRGBFillColor(context, 161.0/ 255.0, 161.0 /255.0, 161.0 / 255.0, 0.7);
    CGContextSelectFont(context, "Helvetica", 10, kCGEncodingMacRoman);
    CGContextSetTextDrawingMode(context, kCGTextFill);
    CGAffineTransform flip = CGAffineTransformMake(1, 0, 0, -1, 0, 0);
    CGContextSetTextMatrix(context, flip);
    CGContextShowTextAtPoint(context, 15.0, 15.0, "test", 4);
    CGContextFillPath(context);
    //CGContextClosePath(context);