Exemplo n.º 1
0
        static ApngBasicWrapper()
        {
            CreateFrame = null;
            SaveAPNG    = null;
            IntPtr apnglib = LoadLibrary(Environment.Is64BitProcess ? "apng64.dll" : "apng32.dll");

            if (apnglib != IntPtr.Zero)
            {
                IntPtr createFramePtr = GetProcAddress(apnglib, "CreateFrame");
                if (createFramePtr != null)
                {
                    CreateFrame = (CreateFrameDelegate)Marshal.GetDelegateForFunctionPointer(createFramePtr, typeof(CreateFrameDelegate));
                }
                IntPtr saveApngPtr = GetProcAddress(apnglib, "SaveAPNG");
                if (saveApngPtr != null)
                {
                    SaveAPNG = (SaveAPNGDelegate)Marshal.GetDelegateForFunctionPointer(saveApngPtr, typeof(SaveAPNGDelegate));
                }
            }
        }
Exemplo n.º 2
0
 static ApngBasicWrapper()
 {
     CreateFrame = null;
     SaveAPNG = null;
     IntPtr apnglib = LoadLibrary(Environment.Is64BitProcess ? "apng64.dll" : "apng32.dll");
     if (apnglib != IntPtr.Zero)
     {
         IntPtr createFramePtr = GetProcAddress(apnglib, "CreateFrame");
         if (createFramePtr != null)
             CreateFrame = (CreateFrameDelegate)Marshal.GetDelegateForFunctionPointer(createFramePtr, typeof(CreateFrameDelegate));
         IntPtr saveApngPtr = GetProcAddress(apnglib, "SaveAPNG");
         if (saveApngPtr != null)
             SaveAPNG = (SaveAPNGDelegate)Marshal.GetDelegateForFunctionPointer(saveApngPtr, typeof(SaveAPNGDelegate));
     }
 }