using (MemoryStream ms = new MemoryStream())
{
image.CreateOptions = BitmapCreateOptions.None;
image.UriSource = new Uri("/Images/chef.png", UriKind.Relative);
WriteableBitmap LoadedPhoto = new WriteableBitmap(image);
LoadedPhoto.SaveJpeg(ms, LoadedPhoto.PixelWidth, LoadedPhoto.PixelHeight,0,95);
ms.Seek(0, 0);
byte[] data = new byte[ms.Length];
ms.Read(data, 0, data.Length);
ms.Close();
}
我在图像处收到NullReferenceException,但我的路径也是正确的,图像也存在。
WriteableBitmap LoadedPhoto = new WriteableBitmap(image);
有什么事吗
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句