Posted By

parkerkrhoyt on 11/17/11


Tagged

phone image standards mobile web capture camera photo Development device phonegap gap


Versions (?)

Using the Device Camera with PhoneGap


 / Published in: JavaScript
 

  1. $( '#camera' ).bind( 'touchstart', function() {
  2. $( this ).attr( 'src', 'assets/camera.down.png' );
  3.  
  4. navigator.camera.getPicture( function( data ) {
  5. $( '#photo' )
  6. .attr( 'src', 'data:image/jpeg;base64,' + data )
  7. .css( 'visibility', 'visible' );
  8.  
  9. $( '#camera' ).attr( 'src', 'assets/camera.up.png' );
  10. }, function( error ) {
  11. console.log( 'Error' );
  12. }, {
  13. destinationType: Camera.DestinationType.DATA_URL,
  14. sourceType: Camera.PictureSourceType.CAMERA,
  15. allowEdit: false,
  16. targetWidth: 260,
  17. targetHeight: 435
  18. } );
  19. } );

Report this snippet  

You need to login to post a comment.