getPicture( onGetPictureError, onGetPictureSuccess, options ) method

Requests retrieval of a picture asynchronously.

Syntax

<static> getPicture( onGetPictureError, onGetPictureSuccess, options )

Parameters

Name Type Description
onGetPictureError anonymous.onGetPictureError Function to be invoked if the attempt to get a picture fails.err will be one of the PictureError codes.
onGetPictureSuccess anonymous.onGetPictureSuccess Function to be invoked if a picture is successfully retrieved.response will either be a Base64-encoded JPG string or a URI.
options anonymous.PictureOptions the options to control the sourceType and destinationType.

Example

// Error handler. will be invoked asynchronously.
fail = function(errorCode){
     // handle error code and take appropriate action.
}
// Success handler. will be invoked asynchronously.
success = function(fileName, content){
     // handle the content. content may be a location or base64 encoded string that is
     // determined by the options passed to the destinationType argument.
}

getPicture(fail,
           success,
           { sourceType: PictureOption.SourceType.CAMERA,
             destinationType: PictureOption.DestinationType.IMAGE_URI
           });

Source

Camera.js, line 161.