> Just plain old 0 worked fine. I just went back and checked the docs, they do
> actually tell you to do that, but I doubt I ever would have seen it. Doesn't
> really make sense, but you get that :)

Actually, it makes perfect sense. The default value for the fill color
is 100% white with 100% alpha (fully opaque), which is 0xffffffff in
ARGB format. You want it to be blank/transparent, so you need to
provide a default fill color that has 0% alpha, so anything of the
form 0x00??????. Using black with zero-alpha is good habit because
it's equivalent to pre-multiplying your colors with black, which is
what works best (or at least most intuitively) with standard computer
blending equations.

The true/false flag just controls whether or not your BitmapData *has*
an alpha channel, not what the contents of that alpha channel are (the
docs should probably be clearer about this and the argument should
probably be named "hasAlphaChannel" as opposed to "transparency", just
to be more explicit). Basically, this flag controls whether your data
is ARGB or RGB (though I wouldn't be surprised if they were both
stored as 32-bits-per-pixel as that normally speeds up blitting since
the pixels are word-aligned).

Troy.

Reply via email to