• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: maintaining alpha value for intersecting lines?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >maintaining alpha value for intersecting lines? (From: Koen van der Drift <email@hidden>)
 >Re: maintaining alpha value for intersecting lines? (From: Andy Lee <email@hidden>)
 >Re: maintaining alpha value for intersecting lines? (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: maintaining alpha value for intersecting lines?
  • Next by Date: Re: Mac cursor hotspot is not at the tip of the cursor
  • Previous by thread: Re: maintaining alpha value for intersecting lines?
  • Next by thread: Re: NSSplitView crash upon restore from 10.8 Versions Browser
  • Index(es):
    • Date
    • Thread