I am trying capture the image using camera and putting in the screen in android. I am using sencha touch 2, phonegap for camera functionality. It is capturing the image but not displaying in the screen.
Here is my code:
In dashboardpanel file:
{
xtype : 'image',
id : 'capturedimage',
src : '',
width : 60,
height: 60,
width : 200
},
{
xtype : 'container',
id : 'btncontainer',
width : 120,
layout : {
type : 'vbox'
},
items : [
{
xtype : 'button',
height : 73,
cls : 'capturebtn',
id : 'capturebtn',
width : 100
},
{
xtype : 'button',
height : 73,
margin : '10 0 0 0',
cls : 'choosephotobtn',
id : 'selectphoto',
width : 100
} ]
},
In Controller file::
onCaptureButtonTap: function(button, e, options) {
/**
* phonegap Camera
*/
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true });
function onFail(message) {
alert('Failed because: ' + message);
}
function onPhotoDataSuccess(imageData) {
// Uncomment to view the base64 encoded image data
console.log(imageData);
// Get image handle
//
var smallImage = document.getElementById('capturedimage');
// Unhide image elements
//
smallImage.style.display = 'block';
// Show the captured photo
// The inline CSS rules are used to resize the image
//
smallImage.src = imageData;
}
}
But it is not coming. Can any one help me please..
Finally i am able to resolve this using the below link:
Solution Link