Test Case
var win = Ti.UI.createWindow({layout: 'vertical'});
var button = Ti.UI.createButton({title: 'take picture'});
button.addEventListener('click', function() {
Ti.Media.showCamera({
'cancel': function() {
Ti.API.info('cancel');
},
'error': function() {
Ti.API.info('error');
},
'success': function(e) {
Ti.API.info('success: size=' + e.media.length);
imageView.image = e.media;
}
});
});
win.add(button);
var imageView = Ti.UI.createImageView();
win.add(imageView);
setTimeout(function() {
Ti.Media.hideCamera();
}, 3000);
win.open();
Expected: Run the application and click "take picture". After you take a picture you should return back to the application and the image should be displayed in the image view. Try clicking "take picture" again, but this time cancel by hitting the back arrow. You shouldn't see any new image and "cancel" should be logged.
We can probably use the camera card to implement this feature. We cannot support overlay views using this method, but in the future we could use the lower level camera API to provide this functionality. This is simliar to how we implemented camera on the Android platform.
Created pull request [#99](https://github.com/appcelerator/titanium_mobile_blackberry/pull/99) for master.
Merged into master. Note, this needs to be added to tiapp.xml
Verified the fix with : Appcelerator Studio: 3.2.0.201310230601 SDK:3.2.0.v20131024120843 alloy: 1.2.2 acs: 1.0.7 npm: 1.3.2 titanium: 3.2.0 titanium-code-processor: 1.0.3 Device:Blackberry Z10(v 10.0) OS: OSX 10.9 Getting captured image in imageView after camera success callback.
Tested and cannot get captured image in imageView after success callback. Environment: Appcelerator Studio, build: 3.3.0.201405161313 Titanium SDK, build: 3.3.0.v20140522144936 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-alpha2 npm@1.3.2 titanium@3.3.0-alpha5 titanium-code-processor@1.1.1 Device: BB Z10 (10.2.1)
PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/261 Permissions needed are:
Tested using Mac osx 10.9.3 Mavericks Appcelerator Studio, build: 3.3.0.201406061445 Titanium SDK, build: 3.3.0.v20140611084912 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-beta npm@1.3.2 titanium@3.3.0-beta2 titanium-code-processor@1.1.1 Device: BB Z10 (10.2.1) After permission was added, I could see the image in the ImageView after success callback. Although the image taken appears rotated, the image is correct in the photo gallery.