예제 #1
0
 public void Dispose()
 {
     if (imgData != IntPtr.Zero)
     {
         NativeImageMethods.DeleteUnmanagedObj(imgData);
         imgData = IntPtr.Zero;
     }
 }
예제 #2
0
 public NativeImage(string filename)
 {
     //load image from filebname
     //1. check if file exit
     if (System.IO.File.Exists(filename))
     {
         //2. then load
         imgData = NativeImageMethods.stbi_load(filename, out width, out height, out component, 4);
         //copy data from unmanaged to managed pointer
         //buffer = new byte[width * height * component];
         //Marshal.Copy(imgData, buffer, 0, buffer.Length);
         //then delete this
     }
 }