如何在Xamarin Forms中使用相机拍摄多张照片? [英] How to take multiple pictures using camera in Xamarin Forms?

查看:468
本文介绍了如何在Xamarin Forms中使用相机拍摄多张照片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,要求通过手机摄像头一次拍摄多张图像.用户不想一次又一次打开相机.

I have an application in which I have a requirement to take multiple images in one shot by phone camera. User don't want to open camera again and again.

我尝试了 https://github.com/jamesmontemagno/MediaPlugin 插件,但它确实可以不支持连续图像捕获.一次单击一张图像.

I have tried https://github.com/jamesmontemagno/MediaPlugin Plugin also but it do not support continuous Images capturing. It clicks one image at a time.

有没有办法实现这种行为?

Is there a way to achieve this behaviour?

谢谢

推荐答案

Can you try this in media plugin
for (int i = 0; i < 3; i++)
{

                            file = await MediaPicker.TakePhotoAsync(new StoreCameraMediaOptions { SaveToAlbum = true, Name = "", Directory = "" });
                            if (file != null)
{
//code to save
}

The user can press cancel at anytime to stop taking pictures, and it'll hit the return and stop running the code. But its ran the logic to save the images each time a photo has been taken.

这篇关于如何在Xamarin Forms中使用相机拍摄多张照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆