IOS作图画三角形

来源:互联网 发布:2016网络主播黑名单 编辑:程序博客网 时间:2024/04/27 16:48

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();


0 0