简体   繁体   English

如何在 Xamarin Forms 中使用相机拍摄多张照片?

[英]How to take multiple pictures using camera in 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.用户不想一次又一次地打开相机。

I have tried https://github.com/jamesmontemagno/MediaPlugin Plugin also but it do not support continuous Images capturing.我也尝试过https://github.com/jamesmontemagno/MediaPlugin插件,但它不支持连续图像捕获。 It clicks one image at a time.它一次单击一个图像。

Is there a way to achieve this behaviour?有没有办法实现这种行为?

Thanks谢谢

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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM