• 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: NSImage and layer transparency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage and layer transparency


  • Subject: Re: NSImage and layer transparency
  • From: Ryan Britton <email@hidden>
  • Date: Sun, 5 Feb 2006 22:20:23 -0800

I have not tried this, but maybe:

void NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op)

Just set the current color to one with an alpha component and fill the appropriate rect. Depending on the effect you want, pick a different compositing operation.

On Feb 5, 2006, at 9:12 PM, patrick wrote:

In Photoshop, one can "lock" a layer's transparency, and then fill the
layer with a particular colour (let's use red for this example). If
some pixels on the layer are 50% opacity, when the red fill occurs,
those pixels will maintain their opacity but will take on the new red
colour.

I'm wondering if there's any way to achieve a similar result
programatically using NSImage? It clearly understands transparency (a
transparent, layered TIFF file loads perfectly), so I'm wondering if
there are any techniques to filling the image with a certain colour
while maintaining the transparency values?

Patrick
 _______________________________________________
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

_______________________________________________ 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: 
 >NSImage and layer transparency (From: patrick <email@hidden>)

  • Prev by Date: NSImage and layer transparency
  • Next by Date: RE: first steps
  • Previous by thread: NSImage and layer transparency
  • Next by thread: COREDATA - setSubEntities doesn't work
  • Index(es):
    • Date
    • Thread