Got things to work with c# on win 7 64 bit

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
jmaeding
Posts: 54
Joined: 2006-05-03T09:48:26-07:00

Got things to work with c# on win 7 64 bit

Post by jmaeding »

There seems to be a lack of examples for calling the imagemagickobject library from c#.
So hopefully this will help others.

I am using VS 2008 on windows 7 64 bit.
I had the 32 bit of IM installed, and the dll referenced, but was getting the error where it could not make the object at runtime.
Seems that is well understood as I was calling a 32 bit dll from a 64 bit prog.

I then reomoved IM and installed the 64 bit version and referenced the new dll.
I think the install registered the new imagemagickobject dll, but I did it anyway and even checked the registry to see that it worked.
Of course, if you are on 32 bit, just use 32 bit install...

Then it took me a while to get the identify command to work. The initial problems I had with 32 bit dll confused me as to if I was creating the right object.
Turns out the examples out there were right, use ImageMagickObject.MagickImage.

Then had thought the filename went first in the params list, but it goes last. I should have known on that.
Anyway, if you reference the dll, and use this code, you should get a valid return:

ImageMagickObject.MagickImage img = new ImageMagickObject.MagickImage();
object[] args = new object[] { "-format", "%r", origName };
object result = img.Identify(ref args);

so that is working so far. Not that complicated once I was done, but the other examples never mention 64 bit issues or show actual c# code.
thanks
James Maeding
Civil Engineer / Programmer
aya
Posts: 1
Joined: 2011-02-14T17:03:49-07:00
Authentication code: 8675308

Re: Got things to work with c# on win 7 64 bit

Post by aya »

Please help...can you post more details?

A link to what you downloaded to get the 64-bit dlls? I've downloaded the installer, but didn't get the ImageMagickObject.dll...

Thanks!
deadlyfingers
Posts: 1
Joined: 2012-09-26T06:17:36-07:00
Authentication code: 67789

Re: Got things to work with c# on win 7 64 bit

Post by deadlyfingers »

Just to recap steps for everyone:

1. Install ImageMagick for Windows
2. In Visual Studio project right-click 'References' and select 'Add Reference".
3. Under the 'COM' tab, select 'ImageMagickObject' to add it.
4. Now in Visual Studio you should now be able to reference it...
using ImageMagickObject;
Post Reply