Re: Compositing to custom view with variable 'pen' and 'paper' colours.
Re: Compositing to custom view with variable 'pen' and 'paper' colours.
- Subject: Re: Compositing to custom view with variable 'pen' and 'paper' colours.
- From: George Orthwein <email@hidden>
- Date: Tue, 27 Jun 2006 11:10:36 -0400
On Jun 26, 2006, at 7:48 AM, Kenny Millar wrote:
Now the bit I cannot figure out, how can I draw the image using
'pen' and 'paper' colours calculated at run time? For example, my
image resource might contain a black and white line drawing of a
house, but I want to display the house as Red on Yellow. (ie, All
the black bits should be draw red, and all the white bits should be
drawn yellow). How can I best achieve that?
The paper color you can do a background fill. For the "pen" color,
you'll want to use your black/white image as a mask where the white
areas are painted and the black aren't. One of the compositing modes
should work for this, explained here:
http://www.cocoabuilder.com/archive/message/cocoa/2002/12/17/51837
(the tinted image link is broken but you can still find it with a
search)
Or, for Core Image, there is the CIMaskToAlpha filter.
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