Initialize() public static method

Adds the specified path to the environment path. You should place the ImageMagick xml files in that directory.
public static Initialize ( string path ) : void
path string The path that contains the ImageMagick xml files.
return void
コード例 #1
0
        private static void ExtractLibrary()
        {
            var name           = NativeLibrary.Name + "-" + NativeLibrary.QuantumName + "-" + NativeLibrary.PlatformName;
            var cacheDirectory = CreateCacheDirectory();
            var tempFile       = Path.Combine(cacheDirectory, name + ".dll");

            WriteAssembly(tempFile);

            MagickNET.SetNativeLibraryDirectory(cacheDirectory);

            MagickNET.Initialize(ConfigurationFiles.Default, cacheDirectory);
        }
コード例 #2
0
        private static void ExtractLibrary()
        {
#if Q8
            string name = "Magick.NET-Q8-" + (NativeLibrary.Is64Bit ? "x64" : "x86");
#elif Q16
            string name = "Magick.NET-Q16-" + (NativeLibrary.Is64Bit ? "x64" : "x86");
#elif Q16HDRI
            string name = "Magick.NET-Q16-HDRI-" + (NativeLibrary.Is64Bit ? "x64" : "x86");
#else
#error Not implemented!
#endif
            string cacheDirectory = CreateCacheDirectory();
            string tempFile       = Path.Combine(cacheDirectory, name + ".Native.dll");

            WriteAssembly(tempFile);

            NativeMethods.SetDllDirectory(cacheDirectory);

            MagickNET.Initialize(ConfigurationFiles.Default, cacheDirectory);
        }