Ejemplo n.º 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");
     }
 }
Ejemplo n.º 2
0
 public void AppendHistory(Dictionary <string, string> metadata)
 {
     foreach (KeyValuePair <String, String> entry in metadata)
     {
         FreeImageIcsNativeMethods.IcsAddHistoryString(this.ics, entry.Key, entry.Value);
     }
 }
Ejemplo n.º 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");
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 5
0
 public void AppendHistory(string key, string value)
 {
     FreeImageIcsNativeMethods.IcsAddHistoryString(this.ics, key, value);
 }
Ejemplo n.º 6
0
 public static bool IsIcsFile(string filepath)
 {
     return(FreeImageIcsNativeMethods.IsIcsFile(filepath) > 0);
 }
Ejemplo n.º 7
0
 public void SetNativeIntensityScale(double origin, double scale, string units)
 {
     FreeImageIcsNativeMethods.SetNativeIntensityScale(this.ics, origin, scale, units);
 }
Ejemplo n.º 8
0
 public void SetNativeScale(int dimension, double origin, double scale, string units)
 {
     FreeImageIcsNativeMethods.SetNativeScale(this.ics, dimension, origin, scale, units);
 }
Ejemplo n.º 9
0
 public void DeleteHistory()
 {
     FreeImageIcsNativeMethods.IcsDeleteHistory(this.ics, "");
 }