Last week my first iPhone app Pixel Painter has finally been approved by Apple and is now available on the App Store.
Pixel Painter is a bare bones drawing application that allows you to create pixel art on the go. It features a 1x1px pen tool, a color picker, an eraser tool, an image position tool and an image lock and zoom tool. Your finished image can than be saved as PNG. If you are into Pixel Art, this app might be for you.
Developing the app was a great learning experience and I’m very eager to share some common pitfalls in iOS development. The next few posts might focus on developing for the iOS platform and especially the transition from ActionScript to Objective-C.
Consoles, Smartphones, Tablets. Motion tracking is everywhere. Here is a simple way to utilise camera motion tracking in your Flash Projects.
A quick rundown on how the motion tracking demo works.
1. Take pictures.
Use the Camera and Video Object to get a steady stream of images. Write each image into BitmapData Object 1.
2. Create a time-delayed copy of each picture.
One frame (or TimerEvent) later copy BitmapData Object 1 into a second BitmapData Object (BitmapData Object 2).
3. Compare the two images.
Use BlendMode.DIFFERENCE to merge the two images. The originated image displays the differing parts between image one and two. Copy it into BitmapData Object 3. If you use the BitmapData function “getColorBoundsRect” you can now return a Rectangle Object. Whenever the with or height of this Object is bigger than 0 motion occurred.
In the Demo, a ColorMatrixFilter and a BlurFilter help to get rid of unimportant motion in the image (slight color changes or background motion). You can use a Sprite container with two added Bitmaps to store the first two BitmapData Objects. This gives you the option to apply filters to the container without having to reapply them every frame.
The example can also be used to create a simple spy cam, using Adobe Air to write BitmapData Object 3 to the File System. This application is also included in the download below.
You can download both motion detection demos, including their source files, from the following URL: