0
我想从StreamImageSource获取流。 我用手机相机拍了一张照片,并在表格上显示一点预览。因此我将图片流加载到ImageSource中。从Imagesource获取流
现在我要回去了......流但我的方法,我总是得到一个异常“无法访问已关闭的流”
private static async Task<Stream> GetStreamFromImageSourceAsync(StreamImageSource imageSource, CancellationToken cancellationToken = default(CancellationToken))
{
if (imageSource.Stream != null)
{
return await imageSource.Stream(cancellationToken);
}
return null;
}
这是调用例程
var s = await GetStreamFromImageSourceAsync((StreamImageSource)item.Source);
s.Position = 0;
在这里我得到的例外,我无法从封闭的流中读取
谢谢你们...
你不能。您需要从相机取出原始图像并保存,以便稍后参考。 – Jason