一、调用摄像头进行扫描
具体步骤:
1。 加入TextBox控件;加入BarcodeButton控件↓
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/163340ke3o3x9tapv3d63p.png)
2, 选择BarcodeButton为对象。在其属性→事件中,双击BarcodeScanned右边空白格,会自己主动跳转到代码编辑页↓
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/163341lvmfm6izzsszfffz.png)
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/163341w96eqk7m7v7kmmvr.png)
3, 写代码↓
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/163341wrvmanvr5ld8jv5u.png)
代码中的↓:
textBox1=
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/163341pzica0io403ial0m.png)
e=当前数据
二、调用摄像头进行拍照。并显示相冊
![](http://www.smobiler.com/bbs/data/attachment/forum/201512/23/174138a0t8mxxpm12t2xx2.jpg)
具体步骤:
1, 加入CameraButton控件↓
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164556qbgfv0v0ks2fdkbd.png)
2, 选中CameraButton控件为对象→事件→ImageCaptured双击,进入代码编辑页面↓
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164556qt4t2f52bghgppjd.png)
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164556f2199mx9g57xh1vn.png)
3, 写代码↓
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164707ur0g95izkbgcbgcz.png)
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164557xtqqrjrmr8jjam8j.png)
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164557d5nqq681d44d409o.png)
4。 加入Image控件↓
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164557jqaf3tatolt2l3bn.png)
属性:![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164557ry5r72f55u7fjf75.png)
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164557ry5r72f55u7fjf75.png)
5。 写代码↓
![](http://www.smobiler.com/bbs/data/attachment/forum/201510/12/164557pz4117p2v4fjbqjc.png)