Re: NSImage Gradient Mask
Re: NSImage Gradient Mask
- Subject: Re: NSImage Gradient Mask
- From: George Orthwein <email@hidden>
- Date: Wed, 24 May 2006 11:28:29 -0400
I think NSCompositePlusDarker is the mode you want with an opaque
black to white gradient and assuming a black background.
CompositeLab is helpful but it doesn't take two images or allow you
to specify a gradient. Is there an updated version of this somewhere?
I suppose it would be easy enough to modify....
/Developer/Examples/AppKit/CompositeLab/
You also may want to have a look at CTGradient to draw the gradient
in code:
http://blog.oofn.net/projects/misc
And the ultimate approach would be to apply transparency to the image
so that it can float over any type of background. Off the top of my
head, you'd probably need to:
- generate a gradient from any opaque color to any transparent color.
- composite with original image as the source using NSCompositeSourceIn
Hope that helps,
George
_______________________________________________
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