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 <koenvanderdr...@gmail.com> 
wrote:

> On Thu, Sep 13, 2012 at 12:00 PM, Andy Lee <ag...@mac.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to