[英]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.