• 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: NSColor opacity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSColor opacity


  • Subject: Re: NSColor opacity
  • From: Dimitri Bouniol <email@hidden>
  • Date: Mon, 29 Jan 2007 23:41:16 -0800

That seems pretty complicated for something as simple as this. Did you try overriding the - (BOOL)isOpaque method in your view?

On Jan 29, 2007, at 11:13 PM, Ken Tozier wrote:

Well I figured out how to do the transparency thing using CGxxx functions. Here's the solution for anyone else who might be interested

NSRect rect = [self bounds];
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGContextSetRGBFillColor (context, 0,1,0, .2);
CGContextFillRect (context, CGRectMake (0, 0, rect.size.width, rect.size.height));


This draws a 20% green screen over the entire bounds rect;


--
Dimitri Bouniol
email@hidden
http://web.mac.com/dimitri008/


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >NSColor opacity (From: Ken Tozier <email@hidden>)
 >Re: NSColor opacity (From: "I. Savant" <email@hidden>)
 >Re: NSColor opacity (From: Ken Tozier <email@hidden>)
 >Re: NSColor opacity (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: NSColor opacity
  • Next by Date: Re: MenuStatusItem --
  • Previous by thread: Re: NSColor opacity
  • Next by thread: Re: NSColor opacity
  • Index(es):
    • Date
    • Thread