[]
        
(Showing Draft Content)

GrapeCity.Documents.Imaging.GcGifReader

Class GcGifReader

Namespace
GrapeCity.Documents.Imaging
Assembly
GcDocs.Imaging.dll

Allows reading images from a multi-page GIF file/stream.

public class GcGifReader : IDisposable
Inheritance
object
GcGifReader
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

GcGifReader(Stream, bool, int)

Initializes a new instance of GcGifReader class and assigns the input stream.

public GcGifReader(Stream stream, bool ownStream = false, int frameIndex = -1)

Parameters

stream System.IO.Stream

The input stream.

ownStream bool

Indicates if the input stream should be closed when the GcGifReader is disposed.

frameIndex int

Index of a frame to read. Pass -1 to get all frames.

GcGifReader(string, int)

Initializes a new instance of GcGifReader class and assigns the input file.

public GcGifReader(string filePath, int frameIndex = -1)

Parameters

filePath string

Full path to the input .gif file.

frameIndex int

Index of a frame to read. Pass -1 to get all frames.

Properties

CommentCount

Gets the number of Comment Extensions in the source GIF file.

public int CommentCount { get; }

Property Value

int

DpiX

Gets the horizontal DPI of the Logical Screen.

public float DpiX { get; }

Property Value

float

DpiY

Gets the vertical DPI of the Logical Screen.

public float DpiY { get; }

Property Value

float

FilePath

If possible, gets full path to the associated .gif file.

public string FilePath { get; }

Property Value

string

Frames

Gets the list of frames in the associated GIF file.

public IReadOnlyList<GifFrame> Frames { get; }

Property Value

System.Collections.Generic.IReadOnlyList<T><GifFrame>

HasGlobalPalette

Gets a value indicating if there is the Global Color Table in the GIF file.

public bool HasGlobalPalette { get; }

Property Value

bool

IccProfileData

Gets or sets the raw ICC profile data for the frames.

public byte[] IccProfileData { get; set; }

Property Value

byte[]

IsDisposed

Gets a value indicating whether the GcGifReader has been disposed of.

public bool IsDisposed { get; }

Property Value

bool

LogicalScreenHeight

Gets the height, in pixels, of the Logical Screen where the frames will be rendered.

public int LogicalScreenHeight { get; }

Property Value

int

LogicalScreenWidth

Gets the width, in pixels, of the Logical Screen where the frames will be rendered.

public int LogicalScreenWidth { get; }

Property Value

int

LoopCount

Gets the number of iterations the animated GIF should be executed. 0 means infinite loop.

public int LoopCount { get; }

Property Value

int

OwnStream

Gets a value indicating if the associated stream should be closed when the GcGifReader is disposed.

public bool OwnStream { get; }

Property Value

bool

PixelAspectRatio

Gets the quotient of the pixel's width over its height.

public float PixelAspectRatio { get; }

Property Value

float

Stream

Gets the Stream associated with GcGifReader.

public Stream Stream { get; }

Property Value

System.IO.Stream

StreamStartPosition

Gets the start position in the associated Stream.

public long StreamStartPosition { get; }

Property Value

long

Methods

ApplyLicenseKey(string)

Applies a license key to an instance of GcGifReader.

public void ApplyLicenseKey(string key)

Parameters

key string

The license key to set.

Dispose()

Clean up any resources being used.

public void Dispose()

Dispose(bool)

Performs cleanup operations on managed and unmanaged resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

~GcGifReader()

Performs cleanup operations on unmanaged resources.

protected ~GcGifReader()

GetComment(Encoding, int)

If the Comment Extension is present in the source GIF file this method decodes the comment using the specified Encoding and returns it as a string.

public string GetComment(Encoding textEncoding, int commentIndex = 0)

Parameters

textEncoding System.Text.Encoding

Character encoding, such as Encoding.ASCII.

commentIndex int

Index of the Comment Extension, from 0 to CommentCount - 1.

Returns

string

Comment as a string or null if the source GIF file contains no Comment Extension with given index.

GetCommentData(int)

If the Comment Extension is present in the source GIF file this method returns the comment data as is, without decoding.

public byte[] GetCommentData(int commentIndex = 0)

Parameters

commentIndex int

Index of the Comment Extension, from 0 to CommentCount - 1.

Returns

byte[]

Comment as a byte array or null if the source GIF file contains no Comment Extension with given index.

GetGlobalPalette()

Returns a palette with sorted opaque colors in 32-bit ARGB format retrieved from the Global Color Table.

public uint[] GetGlobalPalette()

Returns

uint[]