简体   繁体   English

Xam.Plugin.Media的方法“ TakePhotoAsync”在Xamarin.Forms的平台WinPhone上返回null

[英]Method “TakePhotoAsync” of Xam.Plugin.Media return null on platform WinPhone in Xamarin.Forms

I'm new to Xamarin and Xamarin Forms. 我是Xamarin和Xamarin Forms的新手。 I do not understand how come the method "TakePhotoAsync" of plugin Xam.Plugin.Media return null lifting up a System.NullReferenceException. 我不明白插件Xam.Plugin.Media的方法“ TakePhotoAsync”为什么会返回null从而提升System.NullReferenceException。 Variable media is correctly initialized. 可变媒体已正确初始化。 This is part of the code: 这是代码的一部分:

var file = await media.TakePhotoAsync(new StoreCameraMediaOptions
                {
                    DefaultCamera = CameraDevice.Rear,
                    Directory = "TestPhoto",
                    Name = "Photo.jpg",
                    SaveToAlbum = true
                });

Exactly variable file is null, why?! 变量文件恰好为空,为什么?!

Due to this link you have to do next thing: 由于此链接,您必须做下一件事: 在此处输入图片说明

Updated 更新

Components 组件

在此处输入图片说明 在此处输入图片说明

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

相关问题 Xamarin Forms 和 xam.plugin.media:无法解析对 Xamarin.Essentials.Permissions 的引用 - Xamarin Forms and xam.plugin.media: could not resolve reference to Xamarin.Essentials.Permissions 无法使用Xam.Plugin.Media插件 - Can't use Xam.Plugin.Media plugin 如何使用 Xam.Plugin.Media 从图片库中添加照片? - How to add photo from gallery in Image with Xam.Plugin.Media? 使用xam.plugin.media将映像上传到服务器(后端)时收到错误请求 - Am getting Bad Request while uploading an Image to the server (backend) , am using xam.plugin.media 将来自 Xam.Plugin.Media 5.0.1 的 imageSource 转换为 Xamarinforms 中的字节数组? - Convert imageSource coming from Xam.Plugin.Media 5.0.1 to byte array in Xamarinforms? 使用 Xam.Plugin.Media 拍摄和存储用户照片的强制性要求 - Compulsary requirement to take and store users photo using Xam.Plugin.Media 尝试使用Xam.Plugin.Media打开相机时抛出异常 - Exception throw out when trying to open the camera using Xam.Plugin.Media Xamarin.Forms Plugin.Media GetStream / Dispose不存在 - Xamarin.Forms Plugin.Media GetStream/Dispose does not exist Xamarin.Forms for WinPhone无法识别自定义选择器渲染器绘制事件 - Custom picker renderer draw event not recognized in Xamarin.Forms for WinPhone WinPhone上SQLiteDB(或副本)的路径错误。 Xamarin.Forms PCL - Wrong path to SQLiteDB (or copy) on WinPhone. Xamarin.Forms PCL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM