码迷,mamicode.com
首页 > 移动开发 > 详细

IOS作图画三角形

时间:2014-08-27 18:43:18      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:ios

IOS作图画三角形

by 伍雪颖


const CGFloat *color=CGColorGetComponents(popUpColor.CGColor);
UIGraphicsBeginImageContext(CGSizeMake(30, 20));
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(ctx, color[0], color[1], color[2], 1);
CGContextSetShadowWithColor(ctx, CGSizeMake(0, 0), 7.0, [UIColor blackColor].CGColor);
CGPoint points[3] = { CGPointMake(15, 20), CGPointMake(25, 0),
    CGPointMake(5,0)};
CGContextAddLines(ctx, points, 3);
CGContextClosePath(ctx);
CGContextFillPath(ctx);
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();


IOS作图画三角形

标签:ios

原文地址:http://blog.csdn.net/rainlesvio/article/details/38874319

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!