解决方案 »

  1.   

         public static int GetImage(byte[] b, int start, out BitmapSource bi)
            {
                int s = start;
                int picsize;
                bi = null;
               
                // s += Utils.GetInteger(b, s, out picsize);
                try
                {
                    MemoryStream ms = new MemoryStream(b, s, b.Length);
                    JpegBitmapDecoder decoder = new JpegBitmapDecoder(ms, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.OnLoad);
                   
                    bi = decoder.Frames[0];
                    ms.Close();
                    s += b.Length;
                }
                catch (InvalidOperationException ex)
                {
                    //MessageBox.Show(ex.Message.ToString());
                }
                return s - start;
            }
    这是我的代码,请问是哪里出了问题