Hi,
first post, hopefully the first of many.
I use a language that lets me use DLLs in the following way:
LOAD DLL filename$
CALL DLL function$, [parameter1, parameter2...]
I can use any DLL function that is available in the exported table, and up to 9 parameters (integer, float, string). I can also return 1 parameter.
Can you tell me if this approach is compatible with IM, and if so which download I need. Ideally, I would like to simply include the dll in the installation directory, without the need to register it. This is a Windows based application.
Thanks in advance for your help!
How do I use IM in a non-standard language
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
You might be able to use the MagickWand "wrapper".
Start by trying a simple program which just initializes IM and then closes it. Something like this:
I've assumed that you're using a static release version of ImageMagick that's in the current directory.
If that doesn't work you're probably dead in the water.
Next step would be to try to call one MagickWand function which returns a string and see if you can print out the string (I'm guessing at the syntax):
If that works, you can try to read a builtin image file and write it out:
If logo_out.jpg exists after all that then you should be able to use most of the MagickWand functions.
Pete
Start by trying a simple program which just initializes IM and then closes it. Something like this:
Code: Select all
LOAD DLL "CORE_RL_wand_.dll"
CALL DLL "MagickWandGenesis"
CALL DLL "MagickWandTerminus"
If that doesn't work you're probably dead in the water.
Next step would be to try to call one MagickWand function which returns a string and see if you can print out the string (I'm guessing at the syntax):
Code: Select all
LOAD DLL "CORE_RL_wand_.dll"
CALL DLL "MagickWandGenesis"
version = CALL DLL "MagickGetVersion"
CALL DLL "MagickWandTerminus"
print version$
Code: Select all
LOAD DLL "CORE_RL_wand_.dll"
CALL DLL "MagickWandGenesis"
m_wand = CALL DLL "NewMagickWand"
if m_wand$ = 0 then NewMagickWand failed
err = CALL DLL "MagickReadImage",m_wand$,"logo:"
if err$ = 0 then the read failed
CALL DLL "MagickWriteImage",m_wand$,"logo_out.jpg"
CALL DLL "MagickWandTerminus"
Pete
thanks for the help so far. I need to work on this, I have some issues:
1. It doesn't work with just the Magick Wand dll in the folder. Running the program in the install directory works, but I need to work out which files it is relying on.
2. The first example runs, I can initialise and end the Magick Wand API. calling the version function causes a crash. I tried returning an integer, float and string, but none of them worked.
1. It doesn't work with just the Magick Wand dll in the folder. Running the program in the install directory works, but I need to work out which files it is relying on.
2. The first example runs, I can initialise and end the Magick Wand API. calling the version function causes a crash. I tried returning an integer, float and string, but none of them worked.