• 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 with alpha channel of other NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage with alpha channel of other NSImage


  • Subject: Re: NSImage with alpha channel of other NSImage
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 16 Sep 2006 13:39:24 -0500


On Sep 16, 2006, at 10:33 AM, Alexander Cohen wrote:

How can i get an NSImage of only the alpha channel of another NSImage?

I'll assume that the original NSImage will have an NSBitmapImageRep. Having said that, you could create a new NSBitmapImageRep and use direct pixel access on the original rep, and copy over the alpha value in triplicate to the new rep's RGB comps.


The following sample shows how to do direct pixel access:

<http://developer.apple.com/samplecode/Monochrome_Image/index.html>

Specifically, look at NSImage_monochrome.m. It would be easy to modify this category to suit your needs.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
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 with alpha channel of other NSImage (From: Alexander Cohen <email@hidden>)

  • Prev by Date: Re: End type toBezier line.
  • Next by Date: Drawing 32-bit images into an NSBitmapImageRep
  • Previous by thread: NSImage with alpha channel of other NSImage
  • Next by thread: Drawing 32-bit images into an NSBitmapImageRep
  • Index(es):
    • Date
    • Thread