public GifCube(NGif.GifDecoder decoder) { for (byte frameIdx = 0; frameIdx < decoder.GetFrameCount() && frameIdx < 16; ++frameIdx) { AddFrame(frameIdx, new GifCubeSlice((System.Drawing.Bitmap)decoder.GetFrame(frameIdx))); } }
private void button2_Click(object sender, EventArgs e) { //read the path..................................... this.openFileDialog1.Filter = "Images (*.gif)|*.GIF|" + "All files (*.*)|*.*"; this.openFileDialog1.Multiselect = false; this.openFileDialog1.Title = "Select the Image u want to decode"; string outputPath = "c:\\rahil"; GifDecoder gifDecoder = new GifDecoder(); DialogResult dr = this.openFileDialog1.ShowDialog(); gifDecoder.Read(openFileDialog1.FileName); for (int i = 0, count = gifDecoder.GetFrameCount(); i < count; i++) { Image frame = gifDecoder.GetFrame(i); // frame i frame.Save(outputPath + i+ ".png", ImageFormat.Png); } }