[as3] Drawing BitmapData to erase BitmapData

Hey there. I’m still working on my paint program, and I figured I’d try using the open source, raster-based drawing system from [URL=“http://www.bytearray.org/?p=67”]Bytearray.org to speed up drawing in some of my paint tools. The Raster class has some drawing functions that don’t bother with anti-aliasing, so in some situations, implementing these methods results in faster code than relying on the Graphics package. I’ve gotten a nice speed boost from my rainbow paintbrush, which is pretty neat. Go open source!

Unfortunately, I can’t get the eraser brush to work, even though its code is essentially the same as the other brushes’. And I’ve figured out why; the “erase” and “alpha” blend modes, which my vector-based eraser uses to erase the drawing surface, don’t seem to work when you draw one BitmapData object onto another. I could put the BitmapData in a Bitmap object and draw that, but that’s essentially converting raster data to vector, and then back to raster, which is far slower than any speed improvement I’d get from relying on the Raster class in the first place.

Has anyone here succeeded in using one BitmapData object to erase another, without “wrapping” the eraser BitmapData in a Bitmap object? :ne: