【问题标题】:phoneGap camera image set in sencha touch container backgroundphoneGap 相机图像设置在 sencha 触摸容器背景中
【发布时间】:2014-02-14 11:31:47
【问题描述】:

我必须将 phoneGap camera api 与 sencha touch 结合起来。

我想用phonegap的camera api捕获的图像设置煎茶触摸容器的背景。 谁能给我一些例子或一些想法? 谢谢

我的容器

  ....
  {
   xtype: 'container',
   cls: 'SRCameraButton',
   flex:2,
   itemId   : 'photoBtn',
   action   : 'capture'
   }

【问题讨论】:

    标签: cordova sencha-touch


    【解决方案1】:

    你可以这样做。

        var imageView = Ext.getCmp('imageView');
        Ext.device.Camera.capture({
            success : function(image) {             
                imageView.setHtml('<img src="data:image/png;base64,' + image
                        + '"width=200px height=200px />');
    
            },
            quality : 100,
            destination : 'data',
            source: source
        });
    

    其中 imageView 是容器

        {
            xtype : 'container',
            id : 'imageView',
            width : 200,
            height : 200,
            style : 'margin: 0 auto'
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多