Re: Transparent NSRectFill?
Re: Transparent NSRectFill?
- Subject: Re: Transparent NSRectFill?
- From: "Timothy J. Wood" <email@hidden>
- Date: Fri, 23 Dec 2005 11:31:24 -0800
On Dec 23, 2005, at 9:47 AM, Matt Reagan wrote:
I'm having trouble figuring out a simple way to draw a series of
transparent rectangles into an NSView. I thought maybe the alpha value
of NSColor would allow me to do that, but it doesn't work, it simply
fades the NSColor towards black (blue with a .5 alpha is simply dark
blue).
Are you trying to make it so you can see through the view to the
desktop?
If so, you need to tell the window that it should obey its alpha channel
via -[NSWindow setOpaque:NO]. Otherwise, you'll get a black
contribution
like you're seeing.
Note that if you are using a 'copy' compositing mode with a
non-1.0 alpha,
this is effectively what you are doing (setting some pixels in the
window's
store to a non-1.0 alpha). Normally you'd use the 'source-over' mode if
you want the view underlying your view to be partially visible.
-tim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden