This class represents a frame of the GIF format.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public NotInheritable Class GifFrame _ Inherits Frame
public sealed class GifFrame : Frame
This code sample demonstrates how to create an animated GIF file from several JPEG files. Draw attention, you can use this code to save simple GIF files too (by passing the single frame into it).
Dim dir As String = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\" Dim images As String() = {"Blue hills.jpg", "Sunset.jpg", "Water lilies.jpg", "Winter.jpg"} Dim image As String Dim bitmap As New Aurigma.GraphicsMill.Bitmap Dim writer As New Aurigma.GraphicsMill.Codecs.GifWriter("C:\Slideshow.gif") For Each image In images bitmap.Load(dir & image) bitmap.ColorManagement.PaletteEntryCount = 32 bitmap.ColorManagement.ConvertToIndexed(8, Aurigma.GraphicsMill.ColorPaletteType.Adaptive, _ Nothing) Dim frame As New Aurigma.GraphicsMill.Codecs.GifFrame frame.Delay = 100 frame.SetBitmap(bitmap) writer.AddFrame(frame) frame.Dispose() Next bitmap.Dispose() writer.Dispose()
string dir = @"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures"; string[] images = {"Blue hills.jpg", "Sunset.jpg", "Water lilies.jpg", "Winter.jpg"}; using (Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap()) { using (Aurigma.GraphicsMill.Codecs.GifWriter writer = new Aurigma.GraphicsMill.Codecs.GifWriter(@"C:\Slideshow.gif")) { foreach (string image in images) { bitmap.Load(dir + image); bitmap.ColorManagement.PaletteEntryCount = 32; bitmap.ColorManagement.ConvertToIndexed(8, Aurigma.GraphicsMill.ColorPaletteType.Adaptive, null); using(Aurigma.GraphicsMill.Codecs.GifFrame frame = new Aurigma.GraphicsMill.Codecs.GifFrame()) { frame.Delay = 100; frame.SetBitmap(bitmap); writer.AddFrame(frame); } } } }