如何将FreeImage.dll添加到C#项目
我已经成功地将其他.dll文件添加到其他C#项目中:
Right click Reference > Add Reference > Browse > Double click the .dll file
但Microsoft Visual Studio 2008发出以下投诉:
A reference to ...\dll\FreeImage.dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
我正在使用.NET Framework 3.5。 我相信这是一个32位的dll(它是用FreeImage3151Win32下载的)所以我把项目的配置更改为x86。
将FreeImage.dll添加到C#项目的正确方法是什么?
使用下载中提供的wrapper
。 \Wrapper\FreeImage.NET\cs\Samples
目录中有C# \Wrapper\FreeImage.NET\cs\Samples
。
FreeImage.dll不是.Net dll。 你需要在.Net中编写一个包装器来调用未成像代码的方法。 这里有一个例子,但它们也在二进制发行版中提供了一个.net包装器
我之前已经看到过从Internet上下载的文件系统“阻止”的文件。 尝试进入文件的属性,然后单击“取消阻止”按钮。
在当前版本(3.15.4)中,必须在FreeImage \ Wrapper \ FreeImage.NET \ cs中构建项目以生成C#的DLL。 然后在FreeImage \ Wrapper \ FreeImage.NET \ cs \ Library \ bin \ Release或Debug中找到它。
将文件保存到Bin文件夹,然后单击项目>添加引用>浏览>双击.dll文件
C#sharp有助于链接