Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. function takePicture(){
  2. var options = {
  3. quality: 80,
  4. destinationType: Camera.DestinationType.FILE_URI,
  5. encodingType: Camera.EncodingType.PNG,
  6. mediaType: Camera.MediaType.PICTURE,
  7. pictureSourceType: Camera.PictureSourceType.CAMERA,
  8. allowEdit: true,
  9. targetWidth: 300,
  10. targetHeight: 300,
  11. //saveToPhotoAlbum: true
  12. }
  13.  
  14. navigator.camera.getPicture( onSuccess, onFail, options );
  15.  
  16.  
  17. }
  18. function onSuccess(imageURI) {
  19.  
  20. img.src = imageURI;
  21.  
  22.  
  23. document.getElementById("theFirstStars").classList.remove("hidden");
  24. document.querySelector(".btn-positive").style.display="none";
  25. img.classList.remove("hidden");
  26.  
  27. }
  28. function onFail(message) {
  29. alert('Failed because: ' + message);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement