What is a froum thread where only one person is writing - A blog - as such I will give my Subjective Blog (ie my opinion which you may very well disagree with)
The Facts (for a beginner):
Complining/building this from source is not suitable for begginers- or the hobby VBA person.
You will get very little to no help here
The configure.exe program does not work every time
If you get as far as to have this in Visual Studio and build it - it will also not always work
The code and method of building the mageMagickObject does not work at all.
So what are your options.
1. You want to keep trying with a build.
a - As of 23/02/2010 the instructions here seem out of date.
http://www.imagemagick.org/script/insta ... hp#windows You do not have to build the configure program.
b - Notwithstanding what is in the instuctions I could only get a multi-threaded dll to work later - so I did not choose static here. I also unchecked the X11.
c - once you run this there is a new file that is produced which is a "workspace file" this is a file that is recognised by Visual Studio - (dsw) is for 6 and (sln) for 2005. I had Visual Studio 2009 and the produced (sln) never opened without needing to do an "ungrade" of the sln - which appears to be compatible with VS 2005. Also this does not work error free.
d. Follow the instructions then word for word on building. This BIN folder will have almost everything you need.
e. As you see in my post above the instuctions here
http://www.imagemagick.org/script/ImageMagickObject.php simply do not work - I have tried it on 2 computers with 3 operating systems.
f. But stress less cause I am not sure you need it. Just use one of the downloads here
http://www.imagemagick.org/script/binar ... hp#windows which has the ImageMagickObject in it.
g. Then here is my dumb way of cutting this down to the minimum which at this stage is working for me with "Convert" and doing things like resize,thumbnail, compose
h. Go to the bin folder and take these files (the reason for taking these is the ImageMagickObject.dll will not register without these);
CORE_RL_tiff.dll
CORE_RL_ttf.dll
CORE_RL_wand.dll
CORE_RL_xlib.dll
CORE_RL_zlib.dll
CORE_RL_Magick_.dll
CORE_RL_lcms.dll
CORE_RL_bzlib.dll
CORE_RL_jpeg.dll
CORE_RL_.png
Of course you need the ImageMagickObject.dll which you ripped off from one of the downloads
Then you need to look at these files in the BIN folder "IM_MOD_RL_jpeg_.dll" see that each on has a image fomat in the name. What this means is that this dll is for jpeg. So for me I am possible only dealing with jpeg, gif and png so I have taken only those.
Put all these into a folder and then register the ImageMagickObject.dll. (google register .dll to learn how to do that)
Now you can reference your ImageMagickObject.dll in your VBA project.
(I think also the portable version may also produce similar .dll's as the build does so you might be able to sue them)
2. Use the command line from VBA. People you will loose a lot of hair doing 1 above if you do not know what you are doing. You can write your command line code in notepad and save it as a .bat file and then with VBA execute the .bat file for you. VBA can also write to a file and then save it as a .bat file as well. All the code you see here in the forum is designed for unix scripts as the coders are from a unix background so you need to look here to understand what you are doing
http://www.imagemagick.org/Usage/windows/#scripts. Then once you have saved your bat file in VBA you use Shell to execute it.
As far as I can see lets say you only want to use "Convert" then go here
http://www.imagemagick.org/script/binar ... hp#windows and download the portable version. Then you can just take the convert.exe file as this is all you need. At least till now my limited testing has all gone good.
3. A small variation of 2 is that
http://www.imagemagick.org/Usage/windows/#scripts at the bottom it talks about VBScript. VBA can do this as well. In fact the code they have there can be cut and copied into your VBA project. They do choose a rather hard example to understand so here is a simple example
Code: Select all
Dim myWS
Dim command
Dim objExec
Set myWS = CreateObject("WScript.Shell")
command = "full_path_to_your_\convert.exe full_path_to_the_image_input\new.jpg -thumbnail 160x120 full_path_to_the_image_output\thumbnail.png"
'this is one method to execut it and objExec will give you any output you might want or need
Set objExec = myWS.Exec(command)
'this is a second alternative - this might be better as that "True" makes the command wait till it has executed which you really should watch as VBA sometimes moves on to the next lines of code without waiting for this to finish
myWS.Run command, 7, True
Set myWS = Nothing
So finally if you look in this forum there was a guy that could not get a straight answer about what files he needed. The conclusion to that thead
viewtopic.php?f=8&t=12121 was a dissapointing "pay someone to build it for you". That does not help the forum but also it does not help him. If you are going to pay something then go find an image manipuation program that is not free and pay for it. Then at least you have a chance of getting help in the future.