Diadraw Air Camera is an Adobe Native Extension that allows you to capture static frames from the iPhone/iPad video camera at a chosen frame rate and resolution. It is possible to choose whether to lock the focus, exposure or white balance or to have them done automatically by the camera.

It is also possible to set a point of interest to expose for or to focus on. The extension also allows you to rotate, crop or translate frames.

Sample

private var m_lastFrameIdx : Number;

var minFramesPerSecond : Number = 15;
var maxFramesPerSecond : Number = 30;

var usingFrontCamera : Boolean = false;

if ( m_cameraExt.startVideoCamera( NativeCameraExtension.Preset640x480, 
                                   minFramesPerSecond, 
                                   maxFramesPerSecond, 
                                   usingFrontCamera ) )
{
     m_lastFrameIdx = int.MIN_VALUE;
     m_cameraExt.addEventListener( NativeCameraExtensionEvent.IMAGE_READY, handleImageReady );
}

private function handleImageReady( _event : NativeCameraExtensionEvent ) : void
{
    // Create a ByteArray to get the frame data into. You don't need to resize the array:
    m_byteArray = new ByteArray();                   
    var currentFrameIdx : Number = m_cameraExt.getFrameBuffer( m_byteArray, m_lastFrameIdx );

    // Check if we have already got this frame:                                
    if ( currentFrameIdx != m_lastFrameIdx )
    {
        m_lastFrameWidth = _event.frameWidth;
        m_lastFrameHeight = _event.frameHeight;

        // Extract BitmapData from the ByteArray
        var bd : BitmapData = new BitmapData( m_lastFrameWidth, m_lastFrameHeight, true );
        bd.setPixels( renderRect, _byteArray );

        // Perform any pixel processing here

        m_lastFrameIdx = currentFrameIdx;
    }       
}

// x and y can come from the point, where the user tapped the screen:
var pointOfInterest : Point = new Point( x, y );
m_cameraExt.setFocusMode( NativeCameraExtension.FocusModeContinuousAutoFocus, pointOfInterest );

// x and y can come from the point, where the user tapped the screen:
var pointOfInterest : Point = new Point( x, y );
m_cameraExt.setExposureMode( NativeCameraExtension.ExposureModeContinuousAutoExposure, pointOfInterest );
Air Native Extension, iOS . URL.