簡體   English   中英

如何檢查圖像是否正確轉換為wp7中的字節數組

[英]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);
            }

誰能告訴我它是否工作正常,或者如何檢查它是否正常工作。 提前致謝!!

  1. 使用FileStream將其保存到文件
  2. 嘗試打開文件。 如果打開正確-問題出在服務器端。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM