draw ios quartz 2d path with a varying alpha component
Posted
by
Giovanni
on Stack Overflow
See other posts from Stack Overflow
or by Giovanni
Published on 2011-02-06T15:23:09Z
Indexed on
2011/02/06
15:25 UTC
Read the original article
Hit count: 356
Hi, I'd like to paint some Bezier curves with the alpha channel that is changing during the curve painting. Right now I'm able to draw bezier paths, with a fixed alpha channel. What I'd like to do is to draw a single bezier curve that uses a certain value of the alpha channel for the first n points of the path another, alpha value for the subsequent m points and so on. The code I'm using for drawing bezier path is:
CGContextSetStrokeColorWithColor(context, curva.color.CGColor);
....
CGContextAddCurveToPoint(context, cp1.x, cp1.y, cp2.x, cp2.y, endPoint.x, endPoint.y);
....
CGContextStrokePath(context);
Is there a way to achieve what I'm describing?
Many thanks, Giovanni
© Stack Overflow or respective owner