Camera
Required Phonegap plugins
API Documentation
Method Summary
getPicture
Type
Name
Summary
Required
Example Usage
var options = {
quality: 50,
destinationType: 0,
sourceType: 1,
correctOrientation: true
}
/**
* Hook up to a button or element with an onAction event to start the camera
* @properties={typeid:24,uuid:"8EEAFB0D-133F-4009-9C41-83B8A890D19B"}
*/
function onAction$takePicture() {
plugins.svyphonegapCamera.getPicture(getPicSuccess, getPicFail, options);
}
/**
* Callback when picture received successfully
* @properties={typeid:24,uuid:"8EEAFB0D-133F-4009-9C41-83B8A890D19B"}
*/
function getPicFail(err) {
//failed to get picture
}
/**
* Callback when picture received successfully
* @properties={typeid:24,uuid:"8EEAFB0D-133F-4009-9C41-83B8A890D19B"}
*/
function getPicSuccess(res) {
//display the image.
elements.contact_photo.imageURL = '';
elements.contact_photo.text = '<img src="data:image/png;base64,' + res + '"/>'
}
Last updated
Was this helpful?