예제 #1
0
 private void Dispose(bool disposing)
 {
     if (!this._disposed)
     {
         if (this._handle != IntPtr.Zero)
         {
             Native.RIL_Close(this._handle);
         }
         this._disposed = true;
     }
 }
예제 #2
0
 public void Load(Stream stream, ImageFormat imageFormat, int frame, Color backgroundColor, LoadOptions loadOptions, System.Drawing.Size maxSize)
 {
     if (this._disposed)
     {
         throw new ObjectDisposedException("CompactImage");
     }
     if (this._handle != IntPtr.Zero)
     {
         Native.RIL_Close(this._handle);
     }
     Native.RLoadOut @out = Native.RIL_Load(null, stream, imageFormat.ToString(), frame, backgroundColor, loadOptions, maxSize, this._progressFunc);
     this._handle         = @out.Handle;
     this._fullSize       = (System.Drawing.Size)@out.FullSize;
     this._size           = (System.Drawing.Size)@out.Size;
     this._depth          = @out.Depth;
     this._numberOfFrames = @out.NumberOfFrames;
     this._loadedFrame    = frame;
     this.OnChanged();
 }
예제 #3
0
 public void Load(Uri url, int frame, Color backgroundColor, LoadOptions loadOptions, System.Drawing.Size maxSize)
 {
     if (this._disposed)
     {
         throw new ObjectDisposedException("CompactImage");
     }
     if ((string.Compare(url.Scheme, "HTTP", true) != 0) && (string.Compare(url.Scheme, "FILE", true) != 0))
     {
         throw new Exception(string.Format("Schema '{0}' is not supported. Only HTTP and FILE schemas are supported.", url.Scheme));
     }
     if (this._handle != IntPtr.Zero)
     {
         Native.RIL_Close(this._handle);
     }
     Native.RLoadOut @out = Native.RIL_Load(url.ToString(), null, null, frame, backgroundColor, loadOptions, maxSize, this._progressFunc);
     this._handle         = @out.Handle;
     this._fullSize       = (System.Drawing.Size)@out.FullSize;
     this._size           = (System.Drawing.Size)@out.Size;
     this._depth          = @out.Depth;
     this._numberOfFrames = @out.NumberOfFrames;
     this._loadedFrame    = frame;
     this.OnChanged();
 }