Solved

saving a group of gif files into animated gif using c#

Posted on 2004-10-04
6
852 Views
Last Modified: 2012-05-05
im working on an animation wizard using c#. the idea is to save the group of gif files into one animated gif file. i read that this could be done using the image.saveadd function, the problem is that i couldnt use this function properly.i cant understand what im supposed to do with the encoderparameters parameter. can anybody give me a sample code explaining how to combine two gif files in one animated gif file for instance??
0
Comment
Question by:huda_qadura
  • 2
6 Comments
 
LVL 15

Accepted Solution

by:
Thogek earned 125 total points
ID: 12219840
Are we talking about this Image.SaveAdd method?
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdrawingimageclasssaveaddtopic1.asp

The encoderParams parameter is apparently an EncoderParameters object, which "encapsulates an array of EncoderParameter objects,", each of which contains "an array of values to an image encoder."  (A bit cryptic, eh?)

EncoderParameters: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdrawingimagingencoderparametersclasstopic.asp
EncoderParameter Members: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdrawingimagingencoderparametermemberstopic.asp

It looks like the EncoderParameter's Encoder property (containing an Encoder object) would be of most interest: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdrawingimagingencoderparameterclassencodertopic.asp
0
 
LVL 15

Expert Comment

by:Thogek
ID: 12220005
There seem to be a few comments out there suggesting that the current .NET image encoders may not be capable of outputting animated GIFs.
http://www.dotnet247.com/247reference/msgs/28/140353.aspx
http://www.developersdex.com/vb/message.asp?p=2919&ID=%3CuoJvo4PjEHA.704%40TK2MSFTNGP09.phx.gbl%3E
0
 
LVL 9

Expert Comment

by:msdixon
ID: 12236998
another problem you'll run into is the color pallete. in order to get a custom pallete you'll have to run some unsafe code, and it's really quite a pain.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question