title: How to take picture and set it as background using phonegap
body: <p>I am using phonegap to build my app, In the app i am building i have a camera which turns on when i open the app and i see camera controls. once i capture the picture the captured picture should get set as my app background image. how can i do that?</p>
  
  <p>here's what i have tried:</p>
  
  <pre><code>    document.addEventListener("deviceready", onDeviceReady, false);
      function onDeviceReady() {
          navigator.camera.getPicture(onSuccess, onFail, { 
              quality: 50,
              destinationType: Camera.DestinationType.FILE_URI,
              encodingType: Camera.EncodingType.JPEG,
              saveToPhotoAlbum: true,
              showOverlay: false
       });
  
      function onSuccess(imageURI) {
              var image = document.getElementById('myImage');
              image.src = imageURI;
              alert(image.src);
              document.body.style.backgroundImage = "url(image.src)";
  
      }
  
      function onFail(message) {
              /*alert("you are closing the camera")*/
          }
      }
  </code></pre>