Return to Snippet

Revision: 53251
at November 17, 2011 08:13 by parkerkrhoyt


Initial Code
$( '#roll' ).bind( 'touchstart', function() {
  $( this ).attr( 'src', 'assets/roll.down.png' );
  
  navigator.camera.getPicture( function( data ) {
    $( '#photo' )
      .attr( 'src', 'data:image/jpeg;base64,' + data )
      .css( 'visibility', 'visible' );
      
    $( '#roll' ).attr( 'src', 'assets/roll.up.png' );        
  }, function( error ) {
    console.log( 'Error' );
  }, {
    destinationType: Camera.DestinationType.DATA_URL,
    sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
    allowEdit: false,
    targetWidth: 260,
    targetHeight: 435,
    mediaType: Camera.MediaType.PICTURE
  } );    
} );

Initial URL


Initial Description


Initial Title
Accessing the Device Photo Gallery with PhoneGap

Initial Tags
phone, image, web

Initial Language
JavaScript