Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, October 6, 2010 2:18:41 PM(UTC)

jigar  
Guest

Groups: Guests
Posts: 3,049

Was thanked: 1 time(s) in 1 post(s)

The problem is that when you are using the LEADTOOLS functions in a class library, the Leadtools.Codecs.???.dlls do not get copied over to the main project's EXE folder.  Visual Studio doesn't detect the Leadtools.Codecs.???.dll files as dependencies so it does not copy them to the main project's output folder.  Because of this you will get either an "Invalid file format" exception or a "Feature not supported" exception.  So what you have to do is add the Leadtools.Codecs.???.dll references to the main project.

Let's say your class library project is called 'MyClassLibrary', and your main application project is called 'MyApplication'.

Your MyClassLibrary references are:

- Leadtools.dll
- Leadtools.Codecs.dll
- Leadtools.Codecs.Bmp.dll

Your MyApplication references are:

- MyClassLibrary.dll

When you build your solution MyClassLibrary.dll, Leadtools.dll, and Leadtools.Codecs.dll will be copied to the MyApplication's output folder.  The output folder for MyApplication will look like this:

- MyApplication.exe
- MyClassLibrary.dll
- Leadtools.dll
- Leadtools.Codecs.dll

When you run your application and you try to load a BMP file it will not find the Leadtools.Codecs.Bmp.dll, so you will get an "Invlaid file format" exception.  To resolve this issue you have to add Leadtools.Codecs.Bmp.dll to your MyApplication project.  This will make Visual Studio copy the Leadtools.Codecs.Bmp.dll to the output folder of MyApplication.

Your MyApplication references should now be:

- MyClassLibrary.dll
- Leadtools.Codecs.Bmp.dll

And the output folder for MyApplication will have:

- MyApplication.exe
- MyClassLibrary.dll
- Leadtools.dll
- Leadtools.Codecs.dll
- Leadtools.Codecs.Bmp.dll

Now if you run your application you will not get "Invalid file format" or "Feature not supported" exceptions.

This applies to all formats, not only BMP.  So if you want to load JPEG, BMP, PNG, and PDF files you need to add all those codecs references to the MyApplication project.  You can read the Files To Be Included With Your Application article to see what DLLs you will need.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2017, Yet Another Forum.NET
This page was generated in 0.171 seconds.