Show / Hide Table of Contents

Class GIFFile

Represents the binary view of a GIF file.

Inheritance
System.Object
ImageFile
GIFFile
Inherited Members
ImageFile.Format
ImageFile.Properties
ImageFile.Thumbnail
ImageFile.Item[Int32]
ImageFile.Encoding
ImageFile.Errors
ImageFile.Save(String)
ImageFile.Save(Stream)
ImageFile.SaveAsync(String)
ImageFile.SaveAsync(Stream)
ImageFile.FromFile(String)
ImageFile.FromFile(String, Encoding)
ImageFile.FromStream(Stream)
ImageFile.FromStream(Stream, Encoding)
ImageFile.FromBuffer(Byte[])
ImageFile.FromBuffer(Byte[], Encoding)
ImageFile.FromFileAsync(String)
ImageFile.FromFileAsync(String, Encoding)
ImageFile.FromStreamAsync(Stream)
ImageFile.FromStreamAsync(Stream, Encoding)
ImageFile.FromStreamInternal(MemoryStream, Encoding)
Namespace: ExifLibrary
Assembly: ExifLibrary.dll
Syntax
public class GIFFile : ImageFile

Constructors

| Improve this Doc View Source

GIFFile(MemoryStream, Encoding)

Initializes a new instance of the GIFFile class from the specified data stream.

Declaration
protected GIFFile(MemoryStream stream, Encoding encoding)
Parameters
Type Name Description
System.IO.MemoryStream stream

A stream that contains image data.

System.Text.Encoding encoding

The encoding to be used for text metadata when the source encoding is unknown.

Properties

| Improve this Doc View Source

BackcolorIndex

Gets the index of the backcolor in the global color table.

Declaration
public byte BackcolorIndex { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

Blocks

Gets the blocks contained in the GIFFile.

Declaration
public List<GIFBlock> Blocks { get; }
Property Value
Type Description
System.Collections.Generic.List<GIFBlock>
| Improve this Doc View Source

ColorResolution

Gets the bumber of bits per primary color available.

Declaration
public byte ColorResolution { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

GCT

Gets the global color table.

Declaration
public byte[, ] GCT { get; }
Property Value
Type Description
System.Byte[,]
| Improve this Doc View Source

HasGCT

Gets whether the file contains a global color table.

Declaration
public bool HasGCT { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsGCTSorted

Gets whether the global color table is sorted.

Declaration
public bool IsGCTSorted { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PixelAspectRatio

Gets the pixel aspect ratio. The actual aspect ratio is calculated as: Aspect Ratio = (Pixel Aspect Ratio + 15) / 64.

Declaration
public byte PixelAspectRatio { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

ScreenHeight

Gets the raster height in pixels.

Declaration
public ushort ScreenHeight { get; }
Property Value
Type Description
System.UInt16
| Improve this Doc View Source

ScreenWidth

Gets the raster width in pixels.

Declaration
public ushort ScreenWidth { get; }
Property Value
Type Description
System.UInt16
| Improve this Doc View Source

SizeOfGCT

Gets the size of the global color table.

Declaration
public byte SizeOfGCT { get; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

Version

Gets the GIF version string. e.g. 89a

Declaration
public string Version { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

Crush()

Decreases file size by removing all ancillary chunks.

Declaration
public override void Crush()
Overrides
ImageFile.Crush()
| Improve this Doc View Source

ReadColorTable(MemoryStream, Int32)

Reads a GIF color table.

Declaration
protected byte[, ] ReadColorTable(MemoryStream stream, int length)
Parameters
Type Name Description
System.IO.MemoryStream stream

A stream that contains image data.

System.Int32 length

Length of color table.

Returns
Type Description
System.Byte[,]
| Improve this Doc View Source

ReadDataBlock(MemoryStream)

Reads data sub-blocks.

Declaration
protected byte[][] ReadDataBlock(MemoryStream stream)
Parameters
Type Name Description
System.IO.MemoryStream stream

A stream that contains image data.

Returns
Type Description
System.Byte[][]
| Improve this Doc View Source

ReadMetadata()

Reads GIF metadata in extension blocks.

Declaration
protected void ReadMetadata()
| Improve this Doc View Source

SaveInternal(MemoryStream)

Saves the ImageFile to the given stream.

Declaration
protected override void SaveInternal(MemoryStream stream)
Parameters
Type Name Description
System.IO.MemoryStream stream

The data stream used to save the image.

Overrides
ImageFile.SaveInternal(MemoryStream)
| Improve this Doc View Source

WriteColorTable(MemoryStream, Byte[,])

Writes GIF color table.

Declaration
protected void WriteColorTable(MemoryStream stream, byte[, ] table)
Parameters
Type Name Description
System.IO.MemoryStream stream

A stream that contains image data.

System.Byte[,] table

Color table.

| Improve this Doc View Source

WriteDataBlock(MemoryStream, Byte[][])

Writes data sub-blocks.

Declaration
protected void WriteDataBlock(MemoryStream stream, byte[][] data)
Parameters
Type Name Description
System.IO.MemoryStream stream

A stream that contains image data.

System.Byte[][] data

A data sub-block

| Improve this Doc View Source

WriteMetadata()

Writes GIF metadata into extension blocks.

Declaration
protected void WriteMetadata()
Back to top Copyright © 2019 Özgür Özçıtak