当前位置:编程学习 > C#/ASP.NET >>

WPF控件异常Object must be initialized before operation can be performed.怎么解决啊?

Object must be initialized before operation can be performed. ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x88982F0C
报错代码出处如下:
  var bytes = File.ReadAllBytes(imageFile);    
            if (bytes == null || bytes.Length == 0)           
     {                    return null;                }   
             using (var ms = new MemoryStream(bytes))         
       {                  
  var decoder = BitmapDecoder.Create(ms, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);                  
  return decoder.Frames.FirstOrDefault();                }
求高手指点~ --------------------编程问答-------------------- 帮你顶上来
wpf没做过
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,