• 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: Compositing to custom view with variable 'pen' and 'paper' colours.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Compositing to custom view with variable 'pen' and 'paper' colours. (From: Kenny Millar <email@hidden>)

  • Prev by Date: Re: Beginner Question About CustomView, -drawRect: and Plotting Data.
  • Next by Date: Re: Full screen tiny issue
  • Previous by thread: Compositing to custom view with variable 'pen' and 'paper' colours.
  • Next by thread: Posting to NotificationCenter from an Open Source app
  • Index(es):
    • Date
    • Thread