I'm working on a little component which is sort of like the fill-in bubbles on standardized tests. The user will use the mouse to scribble within a region. I'll draw into a clip which is on top of the region to fill it up. This is pretty easy.

What I want to do is every time I draw into the region, figure out how much of the region is full by getting a percentage of pixels which are filled vs the amount that aren't.

I imagine there's some slick BitmapData trick which could be used to make this happen, but I'm new to that class and my first guess involves about a million calls to getPixel to find out which are filled and which aren't. That's probably very slow -- surely someone's got a more efficient way to do this sort of thing.

Gskinner's sprites.CollisionDetection class seems like a place to start, but it only returns the bounds of a collision, not the percentage of the target which is covered.

Any ideas?

-josh
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to