Stream stream = WriteableBitmap.PixelBuffer.AsStream()缺失

时间:2013-12-09 18:57:53

标签: c# windows-8 buffer extension-methods

我正在写windows store app(8.1),我有样本(可能是win 8.0):

private WriteableBitmap WriteableBitmap;
…
WriteableBitmap = new WriteableBitmap(500,500);
…
using (Stream stream = WriteableBitmap.PixelBuffer.AsStream())
{
    …
}

所以我创建了新的win 8.1项目并尝试以同样的方式进行,但是当我到达时:

using (Stream stream = WriteableBitmap.PixelBuffer.AsStream())

我的项目不承认*.AsStream()方法,有人可以告诉我原因吗?

1 个答案:

答案 0 :(得分:8)

using System.Runtime.InteropServices.WindowsRuntime;