---
title: "TiffFrame Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffFrame.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/)

# TiffFrame Class
 
This class represents a frame of the TIFF 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 TiffFrame _Inherits Frame
```
 
```csharp
public sealed class TiffFrame : Frame
```
 
## Examples
  
You can use [TiffWriter](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffWriter.htm.md) class instead of the [Save(String, IEncoderOptions)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_Save_2_b73a8298.htm.md) method of the [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md). In particular it enables you to save the image asynchronously.
 
The [TiffWriter](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffWriter.htm.md) class usage is demonstrated below:
 
```
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 bitmap As New Aurigma.GraphicsMill.Bitmap

Dim writer As New Aurigma.GraphicsMill.Codecs.TiffWriter("C:\multipage.tif")

For Each image As String In images
    bitmap.Load(dir & image)

    Dim frame As New Aurigma.GraphicsMill.Codecs.TiffFrame
    frame.Compression = Aurigma.GraphicsMill.Codecs.CompressionType.Lzw
    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.TiffWriter writer =
              new Aurigma.GraphicsMill.Codecs.TiffWriter(@"C:\multipage.tif"))
    {
        foreach (string image in images)
        {
            bitmap.Load(dir + image);

            using (Aurigma.GraphicsMill.Codecs.TiffFrame frame =
                       new Aurigma.GraphicsMill.Codecs.TiffFrame())
            {
                frame.Compression = Aurigma.GraphicsMill.Codecs.CompressionType.Lzw;
                frame.SetBitmap(bitmap);
                writer.AddFrame(frame);
            }
        }
    }
}
```
 
To load the TIFF files that contains multiple frames, you should use a [TiffReader](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffReader.htm.md) class. The code below demonstrates its usage. It reads multipage TIFF file and save each page into the separate JPEG file.
 
```
Dim filename As String = "c:\multipage.tif"

Dim reader As Aurigma.GraphicsMill.Codecs.FormatReader = _
 Aurigma.GraphicsMill.Codecs.FormatManager.CreateFormatReader(filename)

Dim bitmap As New Aurigma.GraphicsMill.Bitmap

For i As Integer = 0 To reader.FrameCount - 1
    Dim frame As Aurigma.GraphicsMill.Codecs.Frame = reader.LoadFrame(i)
    frame.GetBitmap(bitmap)
    frame.Dispose()

    bitmap.Save("c:\frame_" & i & ".jpg")
Next

bitmap.Dispose()

reader.Dispose()
```
 
```csharp
string filename = @"c:\multipage.tif";

using (Aurigma.GraphicsMill.Codecs.IFormatReader reader =
           Aurigma.GraphicsMill.Codecs.FormatManager.CreateFormatReader(filename))
{

    using (Aurigma.GraphicsMill.Bitmap bitmap =
               new Aurigma.GraphicsMill.Bitmap())
    {
        for (int i = 0; i < reader.FrameCount - 1; i++)
        {
            using (Aurigma.GraphicsMill.Codecs.IFrame frame =
                       reader.LoadFrame(i))
            {
                frame.GetBitmap(bitmap);
                bitmap.Save(@"c:\frame_" + i.ToString() + ".jpg");
            }
        }
    }
}
```
 
## 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.TiffFrame
 
## 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_175.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffFrame.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel2.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_14.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ColorProfile.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel1.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_186.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_TiffExtraChannelCollection.htm.md)
  
## See Also

### Reference

- [TiffFrame Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_Codecs_TiffFrame.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
