When writing applications for the web through Flash player, or for a desktop with AIR, we have had access to the Camera
class through ActionScript. This allows us to access different cameras attached to whatever machine we are using. On Android, we can still use the Camera
class to access the default camera on the device and access the video stream it provides for all sorts of things. In this example, we will simply grab a still image from the Camera
feed and save it to the Android CameraRoll
.
We will construct a Video
object to bind the Camera
stream to, and use BitmapData
methods to capture and then save our rendered image using the mobile CameraRoll
API:
1. At a minimum, we need to import the following classes into our project:
import flash.display.BitmapData; import flash.display.Sprite; import flash.display.Stage; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.TouchEvent...