我在下面的代码中将 IRandomAccessStream 转换为 RandomAccessStreamReference,但是当我看到结果时,没有图像可供共享。我该如何处理?
if (imageFile != null)
{
using (IRandomAccessStream fileStream = await util.imageFile.OpenAsync(Windows.Storage.FileAccessMode.Read))
{
this.imageStreamRef = RandomAccessStreamReference.CreateFromFile(imageFile);
this.dataPackageThumbnail = this.imageStreamRef;
// this.imageStream = await util.imageFile.OpenAsync(FileAccessMode.Read);
await fileStream.FlushAsync();
}
}