2013-08-06 62 views

答えて

9

あなたはそのhereため[yourString drawAtPoint:aPoint withAttributes:dictOfAttributes];

ドキュメントを使用することができます。

また、ビュー階層にUILabelを追加するだけでもかまいません。

2

//グラフィックのコンテキストを開始 UIGraphicsBeginImageContext(imageSize);

//get the context for coreGraphics 
CGContextRef ctx = UIGraphicsGetCurrentContext(); 

CGContextSetTextDrawingMode(ctx, kCGTextFill); 
[[UIColor blackColor] setFill]; 
[@"yourstring" drawAtPoint:CGPointMake(0, 0) withAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Helvetica" size:17]}]; 
//make image out of bitmap context 
UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); 
関連する問題