public Frame(string filename, ushort delay = 4, ColorQuantizationQuality quality = ColorQuantizationQuality.Reasonable) { if (filename == null) { throw new ArgumentNullException("filename"); } this._bitmapDisposalRequired = true; this._filename = filename; this.Delay = delay; this.Quality = quality; //todo: normalize frames? //int w = image.Width; //int h = image.Height; //int type = image.getType(); //if ((w != width) || (h != height) || (type != Bitmap.TYPE_3BYTE_BGR)) //{ // // create new image with right size/format // Bitmap temp = new Bitmap(width, height, Bitmap.TYPE_3BYTE_BGR); // Graphics2D g = temp.createGraphics(); // g.drawImage(image, 0, 0, null); // image = temp; //} }
public Frame(Bitmap image, bool isBitmapDisposalRequired = false, ushort delay = 4, ColorQuantizationQuality quality = ColorQuantizationQuality.Reasonable) { this.Image = image; this._bitmapDisposalRequired = isBitmapDisposalRequired; this.Delay = delay; this.Quality = quality; }