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

GDI+ 中发生一般性错误。.

这个问题让人纠结的地方就是, 昨天我在调试程序的时候遇到的, 结果我发现之前一直正常的程序也出现了这个问题。。。奔泪啊。

系统 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+ .NET Windows 7 调试 --------------------编程问答-------------------- 出现这种情况是 流 被关闭所致 --------------------编程问答--------------------
引用 1 楼 51Crack 的回复:
出现这种情况是 流 被关闭所致

你是说  buffer 设为null引起的?   可我把这个步骤放到 Bitmap bit = new Bitmap(ms, true);下面也是一样啊 --------------------编程问答-------------------- GDI+ 编程出现这种错误的原因有很多。
也很普遍,所以你baidu 会有很多解决方案。

楼主的问题,可能是需要填入完整的文件路径...

参考:
http://bbs.csdn.net/topics/330242353
看2楼回答 --------------------编程问答--------------------
引用 3 楼 yanghl1998 的回复:
GDI+ 编程出现这种错误的原因有很多。
也很普遍,所以你baidu 会有很多解决方案。

楼主的问题,可能是需要填入完整的文件路径...

参考:
http://bbs.csdn.net/topics/330242353
看2楼回答


与路径和权限没关系。
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,