**ActionScript 3** FillRect operation on a single channel?

Started by
1 comment, last by Captain P 15 years, 9 months ago
Hi there, I'm relatively new to Actionscript, and for a particular image operation I need to be able to fill *just* the alpha channel of a bitmapData object with a shape, without destroying the color data. Basically, I've got a bitmapData object with a bitmap loaded into the RGB channels, and I want to render a shape to the alpha channel to act as a mask for the image. I know bitmapData has a fillRect(...) function that takes a uint color value, but it seems impossible to apply a color exclusively to the alpha channel without harming the rgb channels. I suppose I could always create a copy bitmap and use it as the alpha channel, but that's a huge waste. Any ideas on the best method of doing this? Thanks in advance. Rate++ for any help (if you care).
--m_nPostCount++
Advertisement
I am not sure this is possible but it is possible to draw the rectangle using an RGBA of 255,255,255,A and then use some kind of blending mode?
Have you looked into the ColorTransform or CopyChannel functions already?
Create-ivity - a game development blog Mouseover for more information.

This topic is closed to new replies.

Advertisement