Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uploadPicture = function(){
- navigator.camera.getPicture(onSuccess, onFail, {
- quality: 100,
- destinationType: Camera.DestinationType.FILE_URI,
- sourceType: 2, // 1 for camera, 2 for gallery
- allowEdit: true, // Can edit the pictures and lets the user pick gallery app
- mediaType: Camera.MediaType.PICTURE,
- encodingType: Camera.EncodingType.JPEG,
- popoverOptions: CameraPopoverOptions,
- // targetWidth: 500,
- // targetHeight: 500,
- saveToPhotoAlbum: false,
- correctOrientation: true // false: switches the height and width });
- function onSuccess(imageURI) {
- var image = document.getElementById('upload-img');
- image.src = imageURI;
- }
- function onFail(message) {
- alert('Failed because: ' + message);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement