Re: Loading Bitmaps with Transparency (Newbie)
Re: Loading Bitmaps with Transparency (Newbie)
- Subject: Re: Loading Bitmaps with Transparency (Newbie)
- From: "John C. Randolph" <email@hidden>
- Date: Sat, 24 Nov 2001 23:45:20 -0800
On Saturday, November 24, 2001, at 10:31 PM, Eric Hon-Anderson wrote:
>
I have a large number of bitmap (.bmp) files in which all pixels with a
>
specific color (red=0, green=255, blue=0) are intended to be
>
transparent. I can read and display the files themselves just fine with
>
NSImage, but when drawing or compositing the images, the green is drawn
>
like any other color would be (no surprise, since I don't know how to
>
tell the system I want the green to vanish). My question is, what
>
SHOULD I do to make it vanish? (Given the number of files, I hope you
>
won't say, "make the images tranparent in Photoshop by hand.")
Let's see..
I think that in your shoes, I'd be writing a -chromaKey method for
NSBitmapImageRep that examined the image data, and converted any
RGB(0,255,0) pixel to an RGBA(0,0,0,0) pixel.
-jcr
Support your right to protest a criminal nut-cult.
http://freehenson.da.ru/