Fork me on GitHub

Quart 2D (DrawText)

http://blog.csdn.net/flyhawk007j2me/article/details/6829690有用代码  

CGContextRef context = UIGraphicsGetCurrentContext();

    CGContextSelectFont ( context, "Arial", 22, kCGEncodingMacRoman );

    CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0, -1.0));

    CGContextSetRGBFillColor ( context, 0.0f0.6f0.f1.f );

    CGContextSetRGBStrokeColor(context, 0.6,1,1,1);

 

//    CGContextSetTextDrawingMode(context, kCGTextFill);

// CGContextShowTextAtPoint(context, 10.0, 30.0, kTextString, kTextStringLength);

//    

//    CGContextSetTextDrawingMode(context, kCGTextStroke);

// CGContextShowTextAtPoint(context, 60.0, 60.0, kTextString, kTextStringLength);

    

    NSString* myStr = @"我是中国人";

    UIFont* font = [UIFont systemFontOfSize:12.0];

    [myStr drawInRect: CGRectMake(10, 20, 100, 130) withFont:font lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];

posted on 2012-03-17 13:03  pengyingh  阅读(189)  评论(0)    收藏  举报

导航