I was trying to learn the powerful Degrafa extension in flex, so I decided to make some tests, and I want to share it with all of you, its far from perfect, and its only a minor example of what degrafa can do, but I really like it.
The purpose of this project is to make a 4 squared pop-art like image, based from the input of the webcam, just like the apple photo booth has.
I seems like a basic task at the beginning, because making a surface with the squares above an image was going to be easy.
The problem begun with the web cam, I only have one web cam, so for an hour or so, I assume the method Camera.getCamera, will return me the reference to the only web cam I had… big surprise, this wasn’t true, appears like the operating system has virtual cameras (I suspect why), but these cameras are first, so I decided to put a list and let the user decide which camera he wants to process.
Another tricky one, was that first I tried to put a canvas above the VideoDisplay, another big surprise, you can’t do that, the video display likes to be on top.
This las item keep me thinking about how to mix the input of the camera and blend it to the degrafasurface… I really hope that someone with better skills can tell me a better way, but the solution I found was to use a bitmap fill and copy the bitmap of the videodisplay. Might not be memory efficient, but is not resource hogging.
So, I let you the link to the app:
http://www.zerokernel.com/degrafa-test/
And the link to the code:
http://www.zerokernel.com/degrafa-test/DegrafaExample.zip
(the code is released as is, I’m not responsible if it breaks your computer or your big plasma screen, just be fair and don’t link it directly, give me some credit)
please post your comments and ideas, its the only way we can learn
Related posts: (auto-generated)
- FlexPop Now in Air !! A few months ago I put an example of the...
- Youtube and Flex 3 A time ago google released an SWF/API to interact with...
Related posts brought to you by Yet Another Related Posts Plugin.







Good work. I got a bunch of ideas from this excellent post.