---
title: "GifFrame Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_GifFrame.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# GifFrame Class
 
This class represents a frame of the GIF format.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public NotInheritable Class GifFrame _Inherits Frame
```
 
```csharp
public sealed class GifFrame : Frame
```
 
## Examples
  
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()
```
 
```csharp
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);
            }
        }
    }
}
```
 
## Inheritance Hierarchy
  
- [System.Object](http://msdn2.microsoft.com/en-us/e5kfa45b)
    - [Aurigma.GraphicsMill.LockableObject](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_LockableObject.htm.md)
        - [Aurigma.GraphicsMill.Codecs.Frame](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_Frame.htm.md)
            - Aurigma.GraphicsMill.Codecs.GifFrame
 
## Thread Safety
 Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.
 
## Object Model

[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_150.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_GifFrame.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel1.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_14.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ColorProfile.htm.md)
  
## See Also

### Reference

- [GifFrame Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_Codecs_GifFrame.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
