Inheritance: INativeInstance
コード例 #1
0
 public void SetGeometry(string value)
 {
     using (INativeInstance valueNative = UTF8Marshaler.CreateInstance(value))
     {
         #if PLATFORM_AnyCPU
         if (NativeLibrary.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         NativeMethods.X64.MontageSettings_SetGeometry(Instance, valueNative.Instance);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         NativeMethods.X86.MontageSettings_SetGeometry(Instance, valueNative.Instance);
         #endif
     }
 }
コード例 #2
0
 public void SetTitle(string?value)
 {
     using (var valueNative = UTF8Marshaler.CreateInstance(value))
     {
         #if PLATFORM_AnyCPU
         if (OperatingSystem.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         NativeMethods.X64.MontageSettings_SetTitle(Instance, valueNative.Instance);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         NativeMethods.X86.MontageSettings_SetTitle(Instance, valueNative.Instance);
         #endif
     }
 }
コード例 #3
0
 public static bool Unregister(string name)
 {
     using (INativeInstance nameNative = UTF8Marshaler.CreateInstance(name))
     {
         #if PLATFORM_AnyCPU
         if (NativeLibrary.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         return(NativeMethods.X64.MagickFormatInfo_Unregister(nameNative.Instance));
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         return(NativeMethods.X86.MagickFormatInfo_Unregister(nameNative.Instance));
         #endif
     }
 }
コード例 #4
0
 public static void SetLogEvents(string events)
 {
     using (INativeInstance eventsNative = UTF8Marshaler.CreateInstance(events))
     {
         #if PLATFORM_AnyCPU
         if (NativeLibrary.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         NativeMethods.X64.Magick_SetLogEvents(eventsNative.Instance);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         NativeMethods.X86.Magick_SetLogEvents(eventsNative.Instance);
         #endif
     }
 }
コード例 #5
0
   public void SetSize(string value)
   {
       using (INativeInstance valueNative = UTF8Marshaler.CreateInstance(value))
       {
 #if ANYCPU
           if (NativeLibrary.Is64Bit)
 #endif
 #if WIN64 || ANYCPU
           NativeMethods.X64.MagickSettings_SetSize(Instance, valueNative.Instance);
 #endif
 #if ANYCPU
           else
 #endif
 #if !WIN64 || ANYCPU
           NativeMethods.X86.MagickSettings_SetSize(Instance, valueNative.Instance);
 #endif
       }
   }
コード例 #6
0
 public void GetInfoByName(string name)
 {
     using (INativeInstance nameNative = UTF8Marshaler.CreateInstance(name))
     {
         IntPtr exception = IntPtr.Zero;
         IntPtr result;
         if (NativeLibrary.Is64Bit)
         {
             result = NativeMethods.X64.MagickFormatInfo_GetInfoByName(nameNative.Instance, out exception);
         }
         else
         {
             result = NativeMethods.X86.MagickFormatInfo_GetInfoByName(nameNative.Instance, out exception);
         }
         CheckException(exception);
         Instance = result;
     }
 }
コード例 #7
0
ファイル: MagickColor.cs プロジェクト: soshimozi/MagicK.Net
   public bool Initialize(string value)
   {
       using (INativeInstance valueNative = UTF8Marshaler.CreateInstance(value))
       {
 #if ANYCPU
           if (NativeLibrary.Is64Bit)
 #endif
 #if WIN64 || ANYCPU
           return(NativeMethods.X64.MagickColor_Initialize(Instance, valueNative.Instance));
 #endif
 #if ANYCPU
           else
 #endif
 #if !WIN64 || ANYCPU
           return(NativeMethods.X86.MagickColor_Initialize(Instance, valueNative.Instance));
 #endif
       }
   }
コード例 #8
0
 public bool Initialize(string value)
 {
     using (INativeInstance valueNative = UTF8Marshaler.CreateInstance(value))
     {
         #if PLATFORM_AnyCPU
         if (OperatingSystem.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         return(NativeMethods.X64.MagickColor_Initialize(Instance, valueNative.Instance));
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         return(NativeMethods.X86.MagickColor_Initialize(Instance, valueNative.Instance));
         #endif
     }
 }
コード例 #9
0
   public static void SetLogEvents(string events)
   {
       using (INativeInstance eventsNative = UTF8Marshaler.CreateInstance(events))
       {
 #if ANYCPU
           if (NativeLibrary.Is64Bit)
 #endif
 #if WIN64 || ANYCPU
           NativeMethods.X64.MagickNET_SetLogEvents(eventsNative.Instance);
 #endif
 #if ANYCPU
           else
 #endif
 #if !WIN64 || ANYCPU
           NativeMethods.X86.MagickNET_SetLogEvents(eventsNative.Instance);
 #endif
       }
   }
コード例 #10
0
 public void SetFileName(string value)
 {
     using (INativeInstance valueNative = UTF8Marshaler.CreateInstance(value))
     {
         #if PLATFORM_AnyCPU
         if (OperatingSystem.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         NativeMethods.X64.MagickSettings_SetFileName(Instance, valueNative.Instance);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         NativeMethods.X86.MagickSettings_SetFileName(Instance, valueNative.Instance);
         #endif
     }
 }
コード例 #11
0
 public GeometryFlags Initialize(string value)
 {
     using (INativeInstance valueNative = UTF8Marshaler.CreateInstance(value))
     {
         #if PLATFORM_AnyCPU
         if (NativeLibrary.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         return((GeometryFlags)NativeMethods.X64.MagickGeometry_Initialize(Instance, valueNative.Instance));
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         return((GeometryFlags)NativeMethods.X86.MagickGeometry_Initialize(Instance, valueNative.Instance));
         #endif
     }
 }
コード例 #12
0
 public static MagickRectangle?FromPageSize(string?value)
 {
     using (var valueNative = UTF8Marshaler.CreateInstance(value))
     {
         IntPtr result;
         #if PLATFORM_AnyCPU
         if (OperatingSystem.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         result = NativeMethods.X64.MagickRectangle_FromPageSize(valueNative.Instance);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         result = NativeMethods.X86.MagickRectangle_FromPageSize(valueNative.Instance);
         #endif
         return(MagickRectangle.CreateInstance(result));
     }
 }
コード例 #13
0
ファイル: Magick.cs プロジェクト: Tommy-Hu/Magick.NET
 public static void SetDefaultFontFile(string fileName)
 {
     using (INativeInstance fileNameNative = UTF8Marshaler.CreateInstance(fileName))
     {
         IntPtr exception = IntPtr.Zero;
         #if PLATFORM_AnyCPU
         if (OperatingSystem.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         NativeMethods.X64.Magick_SetDefaultFontFile(fileNameNative.Instance, out exception);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         NativeMethods.X86.Magick_SetDefaultFontFile(fileNameNative.Instance, out exception);
         #endif
         MagickExceptionHelper.Check(exception);
     }
 }
コード例 #14
0
 public IntPtr ToShortArray(int x, int y, int width, int height, string?mapping)
 {
     using (var mappingNative = UTF8Marshaler.CreateInstance(mapping))
     {
         IntPtr exception = IntPtr.Zero;
         IntPtr result;
         #if PLATFORM_AnyCPU
         if (OperatingSystem.IsArm64)
         #endif
         #if PLATFORM_arm64 || PLATFORM_AnyCPU
         result = NativeMethods.ARM64.PixelCollection_ToShortArray(Instance, (UIntPtr)x, (UIntPtr)y, (UIntPtr)width, (UIntPtr)height, mappingNative.Instance, out exception);
         #endif
         #if PLATFORM_AnyCPU
         else if (OperatingSystem.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         result = NativeMethods.X64.PixelCollection_ToShortArray(Instance, (UIntPtr)x, (UIntPtr)y, (UIntPtr)width, (UIntPtr)height, mappingNative.Instance, out exception);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         result = NativeMethods.X86.PixelCollection_ToShortArray(Instance, (UIntPtr)x, (UIntPtr)y, (UIntPtr)width, (UIntPtr)height, mappingNative.Instance, out exception);
         #endif
         var magickException = MagickExceptionHelper.Create(exception);
         if (magickException is null)
         {
             return(result);
         }
         if (magickException is MagickErrorException)
         {
             if (result != IntPtr.Zero)
             {
                 MagickMemory.Relinquish(result);
             }
             throw magickException;
         }
         RaiseWarning(magickException);
         return(result);
     }
 }
コード例 #15
0
 public void SetOption(string?key, string?value)
 {
     using (var keyNative = UTF8Marshaler.CreateInstance(key))
     {
         using (var valueNative = UTF8Marshaler.CreateInstance(value))
         {
             #if PLATFORM_AnyCPU
             if (OperatingSystem.Is64Bit)
             #endif
             #if PLATFORM_x64 || PLATFORM_AnyCPU
             NativeMethods.X64.MagickSettings_SetOption(Instance, keyNative.Instance, valueNative.Instance);
             #endif
             #if PLATFORM_AnyCPU
             else
             #endif
             #if PLATFORM_x86 || PLATFORM_AnyCPU
             NativeMethods.X86.MagickSettings_SetOption(Instance, keyNative.Instance, valueNative.Instance);
             #endif
         }
     }
 }
コード例 #16
0
 public void SetOption(string key, string value)
 {
     using (INativeInstance keyNative = UTF8Marshaler.CreateInstance(key))
     {
         using (INativeInstance valueNative = UTF8Marshaler.CreateInstance(value))
         {
             #if PLATFORM_AnyCPU
             if (NativeLibrary.Is64Bit)
             #endif
             #if PLATFORM_x64 || PLATFORM_AnyCPU
             NativeMethods.X64.MagickSettings_SetOption(Instance, keyNative.Instance, valueNative.Instance);
             #endif
             #if PLATFORM_AnyCPU
             else
             #endif
             #if PLATFORM_x86 || PLATFORM_AnyCPU
             NativeMethods.X86.MagickSettings_SetOption(Instance, keyNative.Instance, valueNative.Instance);
             #endif
         }
     }
 }
コード例 #17
0
ファイル: Environment.cs プロジェクト: HughBliss/Magick.NET
 public static void SetEnv(string?name, string?value)
 {
     using (var nameNative = UTF8Marshaler.CreateInstance(name))
     {
         using (var valueNative = UTF8Marshaler.CreateInstance(value))
         {
             #if PLATFORM_AnyCPU
             if (OperatingSystem.Is64Bit)
             #endif
             #if PLATFORM_x64 || PLATFORM_AnyCPU
             NativeMethods.X64.Environment_SetEnv(nameNative.Instance, valueNative.Instance);
             #endif
             #if PLATFORM_AnyCPU
             else
             #endif
             #if PLATFORM_x86 || PLATFORM_AnyCPU
             NativeMethods.X86.Environment_SetEnv(nameNative.Instance, valueNative.Instance);
             #endif
         }
     }
 }
コード例 #18
0
 public static void SetEnv(string name, string value)
 {
     using (INativeInstance nameNative = UTF8Marshaler.CreateInstance(name))
     {
         using (INativeInstance valueNative = UTF8Marshaler.CreateInstance(value))
         {
             #if PLATFORM_AnyCPU
             if (NativeLibrary.Is64Bit)
             #endif
             #if PLATFORM_x64 || PLATFORM_AnyCPU
             NativeMethods.X64.Environment_SetEnv(nameNative.Instance, valueNative.Instance);
             #endif
             #if PLATFORM_AnyCPU
             else
             #endif
             #if PLATFORM_x86 || PLATFORM_AnyCPU
             NativeMethods.X86.Environment_SetEnv(nameNative.Instance, valueNative.Instance);
             #endif
         }
     }
 }
コード例 #19
0
 public void GetInfoByName(string name)
 {
     using (INativeInstance nameNative = UTF8Marshaler.CreateInstance(name))
     {
         IntPtr exception = IntPtr.Zero;
         IntPtr result;
         #if PLATFORM_AnyCPU
         if (NativeLibrary.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         result = NativeMethods.X64.MagickFormatInfo_GetInfoByName(nameNative.Instance, out exception);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         result = NativeMethods.X86.MagickFormatInfo_GetInfoByName(nameNative.Instance, out exception);
         #endif
         CheckException(exception);
         Instance = result;
     }
 }
コード例 #20
0
            public static string?Description(IntPtr exception)
            {
                IntPtr result;

                #if PLATFORM_AnyCPU
                if (OperatingSystem.IsArm64)
                #endif
                #if PLATFORM_arm64 || PLATFORM_AnyCPU
                result = NativeMethods.ARM64.MagickExceptionHelper_Description(exception);
                #endif
                #if PLATFORM_AnyCPU
                else if (OperatingSystem.Is64Bit)
                #endif
                #if PLATFORM_x64 || PLATFORM_AnyCPU
                result = NativeMethods.X64.MagickExceptionHelper_Description(exception);
                #endif
                #if PLATFORM_AnyCPU
                else
                #endif
                #if PLATFORM_x86 || PLATFORM_AnyCPU
                result = NativeMethods.X86.MagickExceptionHelper_Description(exception);
                #endif
                return(UTF8Marshaler.NativeToManaged(result));
            }
コード例 #21
0
 public static void SetLogEvents(string?events)
 {
     using (var eventsNative = UTF8Marshaler.CreateInstance(events))
     {
         #if PLATFORM_AnyCPU
         if (OperatingSystem.IsArm64)
         #endif
         #if PLATFORM_arm64 || PLATFORM_AnyCPU
         NativeMethods.ARM64.Magick_SetLogEvents(eventsNative.Instance);
         #endif
         #if PLATFORM_AnyCPU
         else if (OperatingSystem.Is64Bit)
         #endif
         #if PLATFORM_x64 || PLATFORM_AnyCPU
         NativeMethods.X64.Magick_SetLogEvents(eventsNative.Instance);
         #endif
         #if PLATFORM_AnyCPU
         else
         #endif
         #if PLATFORM_x86 || PLATFORM_AnyCPU
         NativeMethods.X86.Magick_SetLogEvents(eventsNative.Instance);
         #endif
     }
 }
コード例 #22
0
            public static string?GetFontFamily(IntPtr instance, int index)
            {
                IntPtr result;

                #if PLATFORM_AnyCPU
                if (OperatingSystem.IsArm64)
                #endif
                #if PLATFORM_arm64 || PLATFORM_AnyCPU
                result = NativeMethods.ARM64.Magick_GetFontFamily(instance, (UIntPtr)index);
                #endif
                #if PLATFORM_AnyCPU
                else if (OperatingSystem.Is64Bit)
                #endif
                #if PLATFORM_x64 || PLATFORM_AnyCPU
                result = NativeMethods.X64.Magick_GetFontFamily(instance, (UIntPtr)index);
                #endif
                #if PLATFORM_AnyCPU
                else
                #endif
                #if PLATFORM_x86 || PLATFORM_AnyCPU
                result = NativeMethods.X86.Magick_GetFontFamily(instance, (UIntPtr)index);
                #endif
                return(UTF8Marshaler.NativeToManaged(result));
            }