[英]How to check if an image is converted properly to byte array in wp7
目前,我正在将图像作为字节[]发送到服务器,但是服务器一直在答复“未附加图像”。 那么如何检查图像是否正确转换为字节数组呢? 这是我用于将图像转换为字节数组的代码,
using (MemoryStream ms1 = new MemoryStream())
{
WriteableBitmap btmMap = new WriteableBitmap(image);
// write an image into the stream
Extensions.SaveJpeg(btmMap, ms1,
image.PixelWidth, image.PixelHeight, 0, 100);
// reset the stream pointer to the beginning
ms1.Seek(0, 0);
//read the stream into a byte array
imageData = new byte[ms1.Length];
ms1.Read(imageData, 0, imageData.Length);
}
谁能告诉我它是否工作正常,或者如何检查它是否正常工作。 提前致谢!!
FileStream
将其保存到文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.