I created this example somewhere during the beta phases of Flex 2, and found no reason to actually do something with it (like finishing it) anymore. But today there were some questions about the BitmapData.lock() features on the Flashcoders list, and I’d figured this might be a nice example. Originally intended as a testcase for building Flex components (I’ve come a long way with that, more on that later), this thing seemed the perfect thing to showcase the .lock method with.
Although most of the interface is not really functional yet (I’m intending on making it useable somewhere in the future), the .lock() checkbox is the thing where it’s all about here; uncheck it to make the mandelbrot drawing routine not to be preceded by al .lock() of the bitmap it’s drawing on (and closing it with an unlock again). If you don’t zoom in immediatly, and change the resolution to a very high one (Fraczilla or WS) hit draw, then uncheck and hit draw again, there should be a noticeable difference between the amount of MS it took to draw. If you zoom in further, the actual fractal calculations take alot more time then the drawing of the fractal, and the difference becomes marginal.
Still, if it takes about 200Ms longer to draw on my blazin’ fast duo core machine, the lock() feature has proven itself usefull, hasn’t it ?