windows phone开发之获取摄像头
程序员文章站
2022-03-23 11:46:01
引入命名空间:
Using Microsoft.Phone.Tasks;
代码段:
void cameraCaptureTask_Completed(obje...
引入命名空间:
Using Microsoft.Phone.Tasks;
代码段:
void cameraCaptureTask_Completed(object sender, PhotoResult e)
{
BitmapImage bmp = new BitmapImage();
bmp.SetSource(e.ChosenPhoto);//获取返回的图片
image1.Source = bmp;
}
private void button1_Click(object sender, RoutedEventArgs e)
{
CameraCaptureTask cameraCaptureTask = new CameraCaptureTask();
cameraCaptureTask.Show();//打开摄像头程序
cameraCaptureTask.Completed +=
new EventHandler<PhotoResult>(cameraCaptureTask_Completed);//拍照完返回
}
摘自 _亚
上一篇: unityZXing二维码的生成与扫描