C# 如何在Windows Phone 8.1应用商店中将WriteableBitmap转换为字节[]

C# 如何在Windows Phone 8.1应用商店中将WriteableBitmap转换为字节[],c#,bitmap,windows-phone-8.1,bytearray,writeablebitmapex,C#,Bitmap,Windows Phone 8.1,Bytearray,Writeablebitmapex,我想将一个WriteableBitmap转换为byte[],Internet上有大量的示例,但没有一个是有效的,或者在我的运行时(即Windows Phone 8.1 store项目)中没有当前的方法。 这是我的WriteableBitmap对象 BitmapImage bmpImage = new BitmapImage(new Uri("ms-appx:///Assets/no_pic.png", UriKind.Absolute)); WriteableBitmap DefaultPhot

我想将一个WriteableBitmap转换为byte[],Internet上有大量的示例,但没有一个是有效的,或者在我的运行时(即Windows Phone 8.1 store项目)中没有当前的方法。 这是我的WriteableBitmap对象

BitmapImage bmpImage = new BitmapImage(new Uri("ms-appx:///Assets/no_pic.png", UriKind.Absolute));
WriteableBitmap DefaultPhotoBmp = new WriteableBitmap(bmpImage.PixelWidth, bmpImage.PixelHeight);
使用时

DefaultPhotoBmp.ToByteArray();
从WriteableBitmapEx库中,我认为它不会将内部的图像转换为字节数组,而是将WriteableBitmap对象转换为字节数组。。我需要图像


我所要做的就是转换字节数组中的图片并通过HTTP发送。如何操作?

这在Windows Phone 8.1应用商店应用程序下不起作用。'IBuffer'不包含'AsStream'的定义,最佳扩展方法重载'WindowsRuntimeStreamExtensions.AsStream(IRandomAccessStream)'需要'IRandomAccessStream'类型的接收器。我认为您在该链接上尝试了错误的示例,请查看接受的答案示例。这也是一个Windows Phone 8.1运行时应用程序。WriteableBitmap的SaveJpeg()方法不存在。。