How to use the ImageMagick API without installing ImageMagick

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Posts: 1
Joined: 2017-06-29T07:40:14-07:00
Authentication code: 1151

How to use the ImageMagick API without installing ImageMagick

Post by Rolf_Wetjen »

I've created a Free Pascal (Lazarus) image viewer application (Windows) using the MagickWand and MagickCore API (version 7.0.6-0-Q16-x64).
The ImageMagick files are in an ImageMagick subfolder of the application executable folder.
The relevant Pascal unit is here: ... sp=sharing

In summary:
Create an ImageMagick subfolder in the application executable folder with the same structure as an installed ImageMagick would create in Program Files:
.\ImageMagick holds all DLL library and xml configuration files from the ImageMagick primary folder
(ImageMagick installation: Program Files\ImageMagick)
.\ImageMagick\coders holds all IM_MOD_*.DLL files
(ImageMagick installation: Program Files\ImageMagick\coders)
.\ImageMagick\filters holds all FILTER_*.DLL files
(ImageMagick installation: Program Files\ImageMagick\filters)

Don't define the ImageMagick function as external. Define procedure and function variables and use LoadLibrary / GetProcAdress.
In Pascal this looks like

Code: Select all

  IsMagickWandInstantiated: function: MagickBooleanType; cdecl;
Set some environment variables within the application before loading the ImageMagick libraries.

Post Reply