Bezier drawing with Degrafa
22 October 2008 at 6:33 pm
I’ve made a couple bitmap-based drawing programs in Flash/Flex and figured it’d be fun to make a Bezier-based drawing tool as well. Thinking it couldn’t be too hard, I set out to see what already existed of code out there. I found a couple good resources, but boy was I wrong. Bezier math is kind of complex, at least for someone with limited math skills as myself.
I read and searched and then I saw somebody commenting “Why don’t you just use Degrafa?”. I’ve always thought of Degrafa as a Flex only thing, but Flex is really just a powerful abstraction layer. It’s all Actionscript and so is Degrafa. The more I read in the Degrafa source code, the more I loved it. Degrafa has really good classes for both Cubic and Quadratic beziers that you can easily use straight from AS3. Here’s my first take on this (right click to view source):
I’ll eventually extend this further to a full, but basic drawing program. I’d love some comments on the way I’ve structured this, so if you got the time… thanks! If you want to do anything related to programmatic drawing, make sure you check out Degrafa. Loads of cool stuff you can do with it!