GifEncoderEncodeAnimation Method

Encodes the frames of the specified configuration as an animated GIF image and writes it into the specified stream.


Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.2.0
public static void EncodeAnimation(
	AnimatedGifConfiguration configuration,
	Stream stream


configuration  AnimatedGifConfiguration
An AnimatedGifConfiguration instance describing the configuration of the encoding.
stream  Stream
The stream to save the encoded animation into.



This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the BeginEncodeAnimation or EncodeAnimationAsync (in .NET Framework 4.0 and above) methods for asynchronous call and to set up cancellation or for reporting progress.

To encode Image instances with default configuration you can use the ImageExtensions.SaveAsAnimatedGif methods that provide a higher level access.

To create an animation completely manually you can create a GifEncoder instance that provides a lower level access.


ArgumentNullExceptionconfiguration or stream is .
ArgumentExceptionconfiguration is invalid.

See Also