Re: maintaining alpha value for intersecting lines?
Re: maintaining alpha value for intersecting lines?
- Subject: Re: maintaining alpha value for intersecting lines?
- From: Marcel Weiher <email@hidden>
- Date: Thu, 13 Sep 2012 20:02:46 +0200
More specifically, CGContextBeginTransparencyLayer() and CGContextEndTransparencyLayer() will do what you need, in case you can't use a single bezier path.
You set the global alpha to the transparency you want, start the transparency layer, draw *without the alpha*, end the transparency layer.
Marcel
---- typed into mail ---------------------
CGContextSetAlpha( context , 0.5 );
CGContextBeginTransparencyLayer( context, nil );
[[NSColor colorWithCalibratedRed: 0.1 green: 0.1 blue: 0.1 alpha:1.0] setStroke];
[bezierPath1 stroke];
[bezierPath2 stroke];
CGContextEndTransparencyLayer( context );
---- typed into mail ---------------------
On Sep 13, 2012, at 18:30 , Koen van der Drift <email@hidden> wrote:
> On Thu, Sep 13, 2012 at 12:00 PM, Andy Lee <email@hidden> wrote:
>> Are the lines the same color? Is it possible you can do your drawing in a layer, draw the Bezier paths *without* transparency (alpha = 1), and then apply alpha to the layer?
>>
>
> I am not usijng layers for this. Just drawing paths in my drawRect
> method. But I'll look into it, thanks.
>
> - Koen.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden