Advertisement
Guest User

Untitled

a guest
May 5th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. uploadPicture = function(){
  2. navigator.camera.getPicture(onSuccess, onFail, {
  3. quality: 100,
  4. destinationType: Camera.DestinationType.FILE_URI,
  5. sourceType: 2, // 1 for camera, 2 for gallery
  6. allowEdit: true, // Can edit the pictures and lets the user pick gallery app
  7. mediaType: Camera.MediaType.PICTURE,
  8. encodingType: Camera.EncodingType.JPEG,
  9. popoverOptions: CameraPopoverOptions,
  10. // targetWidth: 500,
  11. // targetHeight: 500,
  12. saveToPhotoAlbum: false,
  13. correctOrientation: true // false: switches the height and width });
  14.  
  15. function onSuccess(imageURI) {
  16. var image = document.getElementById('upload-img');
  17. image.src = imageURI;
  18. }
  19.  
  20. function onFail(message) {
  21. alert('Failed because: ' + message);
  22. }
  23. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement