我正在尝试使用相机 API 拍照并将其显示在屏幕上。我可以拍照。但不知道如何在我的屏幕上显示它。为此,我编写了以下代码:
Ext.define('MyApp.view.CameraPanel', { extend: 'Ext.Panel',
config: {
ui: 'light',
layout: {
type: 'card'
},
items: [
{
xtype: 'button',
handler: function(button, event) {
Ext.device.Camera.capture({
source: 'camera',
destination: 'data',
success: function(image) {
takenimage.setSrc(image);
},
failure: function() {
Ext.Msg.alert('Error', 'There was an error when acquiring the picture.');
},
scope: this
});
},
height: 33,
left: 60,
top: 400,
ui: 'decline-round',
width: 200,
text: 'Take a Photo'
},
{
xtype: 'image',
itemId: 'takenimage',
src: 'image'
}
]
}
});
我是这个煎茶平台的新手。请帮忙。
谢谢