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(); }
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(); }
internal static extern int RIL_Load(string location, IIOStream stream, string formatType, int frame, int backgroundColor, int loadOptions, Size maxSize, Native.ProgressFnc progressFunction, out Native.RLoadOut loadOut);