public static void Run()
{
// ExStart:ConvertGIFImageLayersToTIFF
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_ModifyingAndConvertingImages();
// Load a GIF image and Convert the image to GIF image
Image objImage = Image.Load(dataDir + "asposelogo.gif");
using (GifImage gif = (GifImage)objImage)
{
// Iterate through arry of blocks in the GIF image
for (int i = 0; i < gif.Blocks.Length; i++)
{
// Convert block to GifFrameBlock class instance
GifFrameBlock gifBlock = gif.Blocks[i] as GifFrameBlock;
// Check if gif block is then ignore it
if (gifBlock == null)
{
continue;
}
// Create an instance of TIFF Option class and Save the GIFF block as TIFF image
TiffOptions objTiff = new TiffOptions(TiffExpectedFormat.Default);
gifBlock.Save(dataDir + "asposelogo" + i + "_out.tif", objTiff);
}
}
// ExEnd:ConvertGIFImageLayersToTIFF
}
}