ImageEn, unit iemiscplugins

TIEMiscPluginsImageMagick.RegisterPlugin

TIEMiscPluginsImageMagick.RegisterPlugin


Declaration

class procedure RegisterPlugin(const DllPath: string = ''; IncludeGhostScript: Boolean = False);


Description

Registers the ImageMagick plug-in and adds support for all the file formats that it supports.
If IncludeGhostScript is enabled, PDF and PS formats will be included. This requires the installation of the GhostScript library.

Applications should call this method once only (e.g. at the start of the application). Generally, you are better to use RegisterPlugIns.



Notes:
- Registering the ImageMagick plug-in will remove the following internal formats: ioWEBP and ioHEIF. You should use iomscWEBP and iomscHEIF instead
- The ImageMagick Dlls are best added to the same folder as the EXE. If this is not possible you can specify an alternative DllPath


Demos

Demo  Demos\InputOutput\ImageMagick\ImageMagick.dpr
Demo  Demos\LayerEditing\SVGVectorLayers\SVGLayers.dpr


Examples

// Load an SVG at 200 dpi
ImageEnView1.IO.Params.Dict.Clear();
ImageEnView1.IO.Params.Dict.Insert( 'ImageMagick:Density', 200 );
ImageEnView1.IO.LoadFromFile( 'D:\SVG\Lion.svg' );

// Save a JPEG as JNG at 95% quality
ImageEnView1.IO.LoadFromFile( 'D:\Image.jpg' );
ImageEnView1.IO.Params.Dict.Clear();
ImageEnView1.IO.Params.Dict.Insert( 'ImageMagick:Quality', 95 );
ImageEnView1.IO.LoadFromFile( 'D:\Image_out.jng' );

// Save a PNG file as a lossless WebP with maximum compression
ImageEnView1.IO.SaveToFile('D:\Image.png');
ImageEnView1.IO.Params.Dict.Insert( 'ImageMagick', TIEDictionary.Create() );
ImageEnView1.IO.Params.Dict.GetDictionary('ImageMagick').Insert( 'webp:lossless', True );
ImageEnView1.IO.Params.Dict.GetDictionary('ImageMagick').Insert( 'webp:method', 6 );
ImageEnView1.IO.SaveToFile('D:\Image_out.webp');