예제 #1
0
 public static void SaveToFile(FreeImageBitmap fib, string filepath, bool save_metadata)
 {
     if (!FreeImageIcsNativeMethods.SaveImage(fib.Dib, filepath, save_metadata))
     {
         throw new FreeImageException("Unable to save file");
     }
 }
예제 #2
0
 public void AppendHistory(Dictionary <string, string> metadata)
 {
     foreach (KeyValuePair <String, String> entry in metadata)
     {
         FreeImageIcsNativeMethods.IcsAddHistoryString(this.ics, entry.Key, entry.Value);
     }
 }
예제 #3
0
        public IcsFile(string filepath)
        {
            if (!IcsFile.IsIcsFile(filepath))
            {
                throw new ArgumentException("Not an Ics File");
            }

            this.filepath = filepath;

            FreeImageIcsNativeMethods.IcsOpen(ref this.ics, filepath, "rw");
        }
예제 #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                // dispose of the unmanaged resources
                if (this.ics != IntPtr.Zero)
                {
                    // If there is history write that.
                    //this.WriteHistory(this.ics);

                    // Dispose of the unmanaged resources
                    FreeImageIcsNativeMethods.IcsClose(this.ics);
                }

                this.disposed = true;
            }
        }
예제 #5
0
 public void AppendHistory(string key, string value)
 {
     FreeImageIcsNativeMethods.IcsAddHistoryString(this.ics, key, value);
 }
예제 #6
0
 public static bool IsIcsFile(string filepath)
 {
     return(FreeImageIcsNativeMethods.IsIcsFile(filepath) > 0);
 }
예제 #7
0
 public void SetNativeIntensityScale(double origin, double scale, string units)
 {
     FreeImageIcsNativeMethods.SetNativeIntensityScale(this.ics, origin, scale, units);
 }
예제 #8
0
 public void SetNativeScale(int dimension, double origin, double scale, string units)
 {
     FreeImageIcsNativeMethods.SetNativeScale(this.ics, dimension, origin, scale, units);
 }
예제 #9
0
 public void DeleteHistory()
 {
     FreeImageIcsNativeMethods.IcsDeleteHistory(this.ics, "");
 }