901010-使用C#中的Graphics.DrawImage函数绘制tiff文件内容 [英] 901010 - drawing a tiff file content by using Graphics.DrawImage function in C#

查看:122
本文介绍了901010-使用C#中的Graphics.DrawImage函数绘制tiff文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 在以下代码中:

图片img = Image.FromFile( @" );
g.DrawImage(img, 0  0 ); 


我收到以下异常:

在System.Drawing.dll中发生了类型为'System.Runtime.InteropServices.ExternalException'的未处理异常

附加信息:GDI +中发生一般错误.
在FromFile函数中.


问题是什么,我该怎么解决?
thx

解决方案

代码本身对我来说很好,请检查您的TIF文件是否未损坏或是否被其他东西使用.
如果遇到权限问题,请尝试其他文件或位置.


hi in the following code:

Image img = Image.FromFile(@"c:\tmp.tif");
g.DrawImage(img, 0, 0);


i get the following exception:

An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in System.Drawing.dll

Additional information: A generic error occurred in GDI+.
in FromFile function.


what''s the problem and what can i do to resolve it?
thx

解决方案

The code itself works fine for me, check your TIF file is not corrupt or in use by something else.
Try a different file, or location, in case it is a permissions issue.


这篇关于901010-使用C#中的Graphics.DrawImage函数绘制tiff文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆