拍照后如何在Sencha Touch的布局中设置该图片?

时间:2012-06-07 06:42:02

标签: camera sencha-touch-2

我正在尝试使用相机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'
        }
    ]
}

});

我是这个sencha平台的新手。请帮忙。

感谢

1 个答案:

答案 0 :(得分:0)

使用html标签,我能解决这个问题..