Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TakePicture()
- {
- event.preveDefault();
- if (!navigator.camera) {
- OpenModalDialog('Alert', 'Camera API not supported', '80%', '20%');
- return;
- }
- var options = {
- quality: 50,
- destinationType: Camera.DestinationType.FILE_URI,
- sourceType: 1, // 0:Photo Library, 1=Camera, 2=Saved Album
- encodingType: 0, // 0=JPG 1=PNG
- saveToPhotoAlbum: true
- };
- navigator.camera.getPicture(
- function (imageData) {
- window.resolveLocalFileSystemURI(imageURI, resolveOnSuccess, fsFail);
- //$('.employee-image', this.el).attr('src', "data:image/jpeg;base64," + imageData);
- // var image = document.getElementById('myImage');
- // image.src = imageURI;
- },
- function () {
- OpenModalDialog('Alert', 'Error taking picture', '80%', '20%');
- },
- options);
- return false;
- }
- function Browse()
- {
- if (!navigator.camera) {
- OpenModalDialog('Alert', 'Camera API not supported', '80%', '20%');
- return;
- }
- navigator.camera.getPicture(onSuccess, onFail, {
- quality: 50,
- destinationType: navigator.camera.DestinationType.FILE_URI,
- sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
- });
- function onSuccess(imageData) {
- // var image = document.getElementById('myImage');
- // image.src = "data:image/jpeg;base64," + imageData;
- }
- function onFail(message) {
- OpenModalDialog('Alert', 'Failed because: ' + message, '80%', '20%');
- }
- }
- function onDeviceReady() {
- OpenModalDialog('Alert', 'navigator' + navigate.camera, '80%', '20%');
- // OpenModalDialog('Alert',' Camera '+navigator.camera,'80%','20%');
- }
- help me..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement