Jump to content
  • Advertisement
Sign in to follow this  
DirectXFreak

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

This topic is 3737 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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).

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!