Class TGif (unit Gif)

Inherits from

TGraphic

Constructors


constructor Create;

Destroy


Functions

procedure Assign(Source: TPersistent);

WriteData

procedure BmpToGif(var ABitmap: TBitmap);

Create

destructor Destroy;

SaveToStream

procedure GifToBmp(var ABitmap: TBitmap);

BmpToGif

procedure LoadFromFile(const Filename: string);

Assign

procedure LoadFromStream(Stream: TStream);

SaveToFile

procedure SaveToFile(const Filename: string);

LoadFromFile

procedure SaveToStream(Stream: TStream);

LoadFromStream

procedure ChangeStatus(LoadStatus: LongInt);

WriteBmpStream

procedure Draw(ACanvas: TCanvas; const Rect: TRect);

SetBitmap

function GetEmpty: Boolean;

Draw

function GetHeight: Integer;

GetEmpty

function GetWidth: Integer;

GetHeight

procedure ReadData(Stream: TStream);

GetWidth

procedure SetHeight(Value: Integer);

ReadData

procedure SetWidth(Value: Integer);

SetHeight

procedure TriggerChangeEvent;

SetInterlaced

procedure WriteData(Stream: TStream);

SetWidth

procedure ConvertGifToBmp(var ABitmap: TBitmap);

GifDecode

procedure DecompressGif;

Decode the GIF

function GetGifVersion: TGifVersion;

Could not make BMP file } { Bit masks for use with NextCode

function GetInterlaced: Boolean;

SetGifVersion

procedure GifError(ErrorStr: String);

Member Functions

TriggerStatusChangeEvent


procedure SetBitmap(newValue: TBitmap);

TriggerChangeEvent

procedure SetGifVersion(newValue: TGifVersion);

GetGifVersion

procedure SetInterlaced(newValue: Boolean);

GetInterlaced

Properties

property Bitmap : TBitmap


property FileName : TFileName


property GifVersion : TGifVersion


property Interlaced : Boolean


property Status : TGifStatus


Events

event OnChange : TNotifyEvent


event OnStatusChange : TStatusChangeEvent


Variables

FBitmap : TBitmap;


BadCodeCount : Word;

Bytes left in block

BitsLeft : Integer;

number of entrys in the color table

BmHeader : TBitmapInfoHeader;

interlace pass number } { Bitmap Data

BmpStream : TMemoryStream;

File Header for bitmap file

BytesLeft : Integer;

bits left in Byte

ClearCode : Integer;

Current size of code in bits

CurrByte : Byte;

the index to the next Byte in the datablock array

CurrCodeSize : Integer;

bad code counter

CurrentX : Integer;

array for buffer line output

CurrentY : Integer;


CurStatus : Integer;


DecodeStack : array[0..MAXCODES] of Byte;

the current Byte

EndingCode : Integer;

Clear code value

FFileName : TFileName;


FGifVersion : TGifVersion;


FOnChange : TNotifyEvent;


FOnStatusChange : TStatusChangeEvent;


FStatus : TGifStatus;

Image data } { Status Variables

GifInfo : TGifInfo;

the file stream for the gif file

GifStream : TMemoryStream;

GIF Data

GlobalColorTable : TColorTable;

gif file header

HighCode : Word;

highest slot position for the current code size

ImageData : TGifDataSubBlock;

minimum size of the LZW codes in bits

ImageLines : TList;


InterlacePass : Byte;

current screen locations

LineBuffer : TGraphicLine;

array for code suffixes

LocalColorTable : TColorTable;

global color table

LZWCodeSize : Byte;

local color table

MaxStatus : Integer;


NextByte : Integer;

highest code that does not require decoding

Prefix : array[0..MAXCODES] of Integer;

stack for the decoded codes

Slot : Word;

ending code value

Suffix : array[0..MAXCODES] of Integer;

array for code prefixes

TableSize : Word;

variable to store incoming gif data

TopSlot : Word;

where next new code will be added


Constructors


constructor Create;

Destroy


Functions


procedure Assign(Source: TPersistent);

WriteData


procedure BmpToGif(var ABitmap: TBitmap);

Create


destructor Destroy;

SaveToStream


procedure GifToBmp(var ABitmap: TBitmap);

BmpToGif


procedure LoadFromFile(const Filename: string);

Assign


procedure LoadFromStream(Stream: TStream);

SaveToFile


procedure SaveToFile(const Filename: string);

LoadFromFile


procedure SaveToStream(Stream: TStream);

LoadFromStream


procedure ChangeStatus(LoadStatus: LongInt);

WriteBmpStream


procedure Draw(ACanvas: TCanvas; const Rect: TRect);

SetBitmap


function GetEmpty: Boolean;

Draw


function GetHeight: Integer;

GetEmpty


function GetWidth: Integer;

GetHeight


procedure ReadData(Stream: TStream);

GetWidth


procedure SetHeight(Value: Integer);

ReadData


procedure SetWidth(Value: Integer);

SetHeight


procedure TriggerChangeEvent;

SetInterlaced


procedure WriteData(Stream: TStream);

SetWidth


procedure ConvertGifToBmp(var ABitmap: TBitmap);

GifDecode


procedure DecompressGif;

Decode the GIF


function GetGifVersion: TGifVersion;

Could not make BMP file } { Bit masks for use with NextCode


function GetInterlaced: Boolean;

SetGifVersion


procedure GifError(ErrorStr: String);

Member Functions

TriggerStatusChangeEvent


procedure SetBitmap(newValue: TBitmap);

TriggerChangeEvent


procedure SetGifVersion(newValue: TGifVersion);

GetGifVersion


procedure SetInterlaced(newValue: Boolean);

GetInterlaced


Properties


property Bitmap : TBitmap


property FileName : TFileName


property GifVersion : TGifVersion


property Interlaced : Boolean


property Status : TGifStatus


Events


event OnChange : TNotifyEvent


event OnStatusChange : TStatusChangeEvent


Variables


FBitmap : TBitmap;


BadCodeCount : Word;

Bytes left in block


BitsLeft : Integer;

number of entrys in the color table


BmHeader : TBitmapInfoHeader;

interlace pass number } { Bitmap Data


BmpStream : TMemoryStream;

File Header for bitmap file


BytesLeft : Integer;

bits left in Byte


ClearCode : Integer;

Current size of code in bits


CurrByte : Byte;

the index to the next Byte in the datablock array


CurrCodeSize : Integer;

bad code counter


CurrentX : Integer;

array for buffer line output


CurrentY : Integer;


CurStatus : Integer;


DecodeStack : array[0..MAXCODES] of Byte;

the current Byte


EndingCode : Integer;

Clear code value


FFileName : TFileName;


FGifVersion : TGifVersion;


FOnChange : TNotifyEvent;


FOnStatusChange : TStatusChangeEvent;


FStatus : TGifStatus;

Image data } { Status Variables


GifInfo : TGifInfo;

the file stream for the gif file


GifStream : TMemoryStream;

GIF Data


GlobalColorTable : TColorTable;

gif file header


HighCode : Word;

highest slot position for the current code size


ImageData : TGifDataSubBlock;

minimum size of the LZW codes in bits


ImageLines : TList;


InterlacePass : Byte;

current screen locations


LineBuffer : TGraphicLine;

array for code suffixes


LocalColorTable : TColorTable;

global color table


LZWCodeSize : Byte;

local color table


MaxStatus : Integer;


NextByte : Integer;

highest code that does not require decoding


Prefix : array[0..MAXCODES] of Integer;

stack for the decoded codes


Slot : Word;

ending code value


Suffix : array[0..MAXCODES] of Integer;

array for code prefixes


TableSize : Word;

variable to store incoming gif data


TopSlot : Word;

where next new code will be added