Guest User

Untitled

a guest
Jan 16th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. function capturePhoto() {
  2.  
  3. networkState = navigator.network.connection.type;
  4.  
  5. if (networkState == Connection.NONE)
  6. {
  7. alert('You must be connected to the internet to use this feature!');
  8.  
  9. }else{
  10.  
  11.  
  12. var options = {
  13. quality: 100,
  14. correctOrientation: false,
  15. destinationType : navigator.camera.DestinationType.FILE_URI,
  16. sourceType: navigator.camera.PictureSourceType.CAMERA,
  17. encodingType: navigator.camera.EncodingType.JPEG,
  18. }
  19. navigator.camera.getPicture(onPhotoDataSuccess, onFail, options);
  20.  
  21. }
  22. }
  23.  
  24. var canvaswidth = window.innerWidth;
  25. var canvasheight = window.innerHeight;
  26.  
  27. var darthVaderImg = new Kinetic.Image({
  28. x: 0,
  29. y: 0,
  30. image: images.darthVader,
  31. width: canvaswidth,
  32. height: canvasheight,
  33. name: "image"
  34. });
  35.  
  36. targetWidth: 320,
  37. targetHeight: 480,
  38.  
  39. var canvaswidth = 320;
  40. var canvasheight = 480;
  41.  
  42. var darthVaderImg = new Kinetic.Image({
  43. x: 0,
  44. y: 0,
  45. image: images.darthVader,
  46. width: canvaswidth,
  47. height: canvasheight,
  48. name: "image"
  49. });
  50.  
  51. window.innerHeight
Add Comment
Please, Sign In to add comment