How to get animated gif animated, using ImageVObject such as those Smiley on the left?
Thanks.
mzhao,
You can use GifWriter Class. The following code creates an animated GIF file from several JPEG images:
string dir = @"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\\";
string[] images = { "Chrysanthemum.jpg", "Desert.jpg", "Jellyfish.jpg", "Tulips.jpg" };
using (var writer = new Aurigma.GraphicsMill.Codecs.GifWriter(@"Images\Slideshow.gif"))
using (var cc = new Aurigma.GraphicsMill.Transforms.ColorConverter(Aurigma.GraphicsMill.PixelFormat.Format8bppIndexed))
{
writer.FrameOptions.Delay = 100;
foreach (string image in images)
{
using (var reader = new Aurigma.GraphicsMill.Codecs.JpegReader(dir + image))
{
Aurigma.GraphicsMill.Pipeline.Run(reader + cc + writer);
}
}
}
You can read about it here:
http://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_GifWriter.htmHope this helps.
Perhaps the question is not how to create an animated GIF, but how to display animated GIF in the CanvasViewer. Is it correct?
If so, could you please clarify why you need it. The idea of the CanvasViewer is that you edit an image consisting of several items (images, texts, etc) and then merge it to one hi-res print-ready file. If you need animated elements, it means that you are using CanvasViewer for some other purposes. If so, we would like to understand your use case.