将IRandomAccessStream转换为RandomAccessStreamReference C#

时间:2012-06-11 18:50:47

标签: c# windows-8 microsoft-metro

我在下面的代码中将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();
    }
}

1 个答案:

答案 0 :(得分:-1)