这个问题让人纠结的地方就是, 昨天我在调试程序的时候遇到的, 结果我发现之前一直正常的程序也出现了这个问题奔泪啊。系统 win7 64     .net版本是3.5 - 4.0
未处理 System.Runtime.InteropServices.ExternalException
  Message=GDI+ 中发生一般性错误。
  Source=System.Drawing
  ErrorCode=-2147467259
  StackTrace:
       在 System.Drawing.Bitmap..ctor(Stream stream, Boolean useIcm)
       在 ConsoleApplication7.Program.Main(String[] args) 位置 D:\Test\ConsoleApplication7\ConsoleApplication7\Program.cs:行号 24
       在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Threading.ThreadHelper.ThreadStart()
  InnerException: GDI+.NETWindows 7调试

解决方案 »

  1.   

    你是说  buffer 设为null引起的?   可我把这个步骤放到 Bitmap bit = new Bitmap(ms, true);下面也是一样啊
      

  2.   

    GDI+ 编程出现这种错误的原因有很多。
    也很普遍,所以你baidu 会有很多解决方案。楼主的问题,可能是需要填入完整的文件路径...参考:
    http://bbs.csdn.net/topics/330242353
    看2楼回答