Re:
On May 15, 2006, at 6:41 AM, Steve Mills wrote:
On May 15, 2006, at 05:25, Arne Scheffler wrote:
I've an index bitmap and I like to create an image where the white
color will be transparent.
I'm not sure how I would create the masking color components for the
second parameter in CGImageCreateWithMaskingColors. Any Hints ?
The important thing to remember is that the colors in the color array
that you supply to CGImageCreateWithMaskingColors are the undecoded
color values in your image.
For an image characterized by an index color space, that is a 1
component image so you supply a masking color array of 2 values, the
min and max color values you want to be transparent (i.e. mask out).
The color value you would use for your array would be the index of
the color in your color table that you want to be transparent. You
should use the same color for the minimum and maximum value of your
masking color.
Say the white color that you want to be transparent is entry 5 in
your color table (note that indexes start at 0). The code could look
like:
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden