Tuesday, 20 August 2013

UiBezierPath and gradient IOS

UiBezierPath and gradient IOS

I have path with values and I want make this gradient.
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [[UIColor
colorWithRed:245.0/255.0 green:245.0/255.0 blue:171.0/255.0 alpha:0.6]
CGColor]);
CGContextSetFillColorWithColor(context, [[UIColor
colorWithRed:245.0/255.0 green:245.0/255.0 blue:171.0/255.0 alpha:0.6]
CGColor]);
UIBezierPath *aPath = [UIBezierPath bezierPath];
[aPath moveToPoint:CGPointMake(30.0, 100.0)];
[aPath addLineToPoint:CGPointMake(200.0, 120.0)];
[aPath addLineToPoint:CGPointMake(300, 210)];
[aPath addLineToPoint:CGPointMake(300, 420)];
[aPath addLineToPoint:CGPointMake(30, 420.0)];
[aPath addLineToPoint:CGPointMake(30, 100.0)];
[aPath closePath];
[aPath fill];
Can You help me with this?

No comments:

Post a Comment