[英]How to check if an image is converted properly to byte array in wp7
Currently i'm sending my image as a byte[] to my server, but my server is constantly replying that "Image is not attached". 目前,我正在将图像作为字节[]发送到服务器,但是服务器一直在答复“未附加图像”。 So how can i check if the image is properly converted to byte array??
那么如何检查图像是否正确转换为字节数组呢? This is the code i've used for converting the image to byte array,
这是我用于将图像转换为字节数组的代码,
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);
}
Could anyone tell me if it works coorectly or how to check if it is working properly. 谁能告诉我它是否工作正常,或者如何检查它是否正常工作。 Thanks in Advance!!
提前致谢!!
FileStream
FileStream
将其保存到文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.