Class TGIFSubImage (unit GIFImage)

Inherits from

TGIFItem

Bit fields

Constructors


constructor Create(GIFImage: TGIFImage);

size of color table as above


Functions

procedure Assign(Source: TPersistent);


procedure Clear;


destructor Destroy;

Remember to synchronize with TGIFSubImage.

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

Dst := Dst OR Mem

procedure LoadFromFile(const Filename: string);


procedure LoadFromStream(Stream: TStream);


procedure SaveToStream(Stream: TStream);

** End block byte

procedure StretchDraw(ACanvas: TCanvas; const Rect: TRect; DoTransparent: boolean);


procedure AssignTo(Dest: TPersistent);

From Mozilla source: Work around more broken GIF files that have zero image width or height

procedure BitmapToDIB(ABitmap: TBitmap);

Create DIB from Bitmap

procedure DIBToBitmap(ABitmap: TBitmap);

Convert DIB created by BitmapToDIB back to a TBitmap

function DoGetBitmap: TBitmap;

Free DIB buffer used for scanline operations

function DoGetDitherBitmap: TBitmap;


procedure FreeBitmap;


procedure FreeDIB;

Free the DIB allocated by BitmapToDIB

procedure FreeMask;


function GetActiveColorMap: TGIFColorMap;


function GetBitmap: TBitmap;

Free DIB buffer used for scanline operations

function GetBitsPerPixel: integer;


function GetBounds(Index: integer): WORD;

Create new bitmap and mask

function GetBoundsRect: TRect;


function GetClientRect: TRect;


function GetColorResolution: integer;


function GetEmpty: Boolean;

bottom-up DIB

function GetInterlaced: boolean;


function GetPalette: HPALETTE;

and (ColorMap.

function GetPixel(x, y: integer): BYTE;


function GetScanLine(Row: Integer): PChar;

Rewind and load DIB into bitmap

function GetVersion: TGIFVersion;


function HasMask: boolean;


procedure NewBitmap;


procedure NewImage;

Need to create new bitmap and repaint

function ScaleRect(DestRect: TRect): TRect;

Given a destination rect (DestRect) calculates the area covered by this sub image

procedure SetBitmap(Value: TBitmap);

OnProgress can raise EAbort to cancel image load

procedure SetBounds(Index: integer; Value: WORD);

To avoid compiler warnings

procedure SetInterlaced(Value: boolean);


procedure SetPalette(Value: HPalette);

Use global palette if everything else fails

procedure Compress(Stream: TStream);

raise GIFException.

procedure Decompress(Stream: TStream);

Found empty slot - key doesn't exist

procedure Prepare;


Properties

property ActiveColorMap : TGIFColorMap


property Bitmap : TBitmap


property BitsPerPixel : integer


property BoundsRect : TRect


property ClientRect : TRect


property ColorMap : TGIFColorMap


property ColorResolution : integer


property Data : PChar


property DataSize : integer


property Empty : boolean


property Extensions : TGIFExtensionList


property GraphicControlExtension : TGIFGraphicControlExtension


property Height : WORD


property Interlaced : boolean


property Left : WORD


property Mask : HBitmap


property Palette : HPALETTE


property Pixels : BYTE


property Top : WORD


property Transparent : boolean


property Version : TGIFVersion


property Width : WORD


Events

Variables

FBitmap : TBitmap;


FColorMap : TGIFColorMap;


FData : PChar;


FDataSize : integer;


FDIBBits : pointer;


FDIBBitsSize : longInt;


FDIBInfo : PBitmapInfo;


FDIBInfoSize : integer;


FExtensions : TGIFExtensionList;


FGCE : TGIFGraphicControlExtension;


FImageDescriptor : TImageDescriptor;


FLocalPalette : HPalette;


FMask : HBitmap;


FNeedMask : boolean;


FTransparent : boolean;



Constructors


constructor Create(GIFImage: TGIFImage);

size of color table as above


Functions


procedure Assign(Source: TPersistent);


procedure Clear;


destructor Destroy;

Remember to synchronize with TGIFSubImage.Clear


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

Dst := Dst OR Mem


procedure LoadFromFile(const Filename: string);


procedure LoadFromStream(Stream: TStream);


procedure SaveToStream(Stream: TStream);

** End block byte


procedure StretchDraw(ACanvas: TCanvas; const Rect: TRect; DoTransparent: boolean);


procedure AssignTo(Dest: TPersistent);

From Mozilla source: Work around more broken GIF files that have zero image width or height


procedure BitmapToDIB(ABitmap: TBitmap);

Create DIB from Bitmap


procedure DIBToBitmap(ABitmap: TBitmap);

Convert DIB created by BitmapToDIB back to a TBitmap


function DoGetBitmap: TBitmap;

Free DIB buffer used for scanline operations


function DoGetDitherBitmap: TBitmap;


procedure FreeBitmap;


procedure FreeDIB;

Free the DIB allocated by BitmapToDIB


procedure FreeMask;


function GetActiveColorMap: TGIFColorMap;


function GetBitmap: TBitmap;

Free DIB buffer used for scanline operations


function GetBitsPerPixel: integer;


function GetBounds(Index: integer): WORD;

Create new bitmap and mask


function GetBoundsRect: TRect;


function GetClientRect: TRect;


function GetColorResolution: integer;


function GetEmpty: Boolean;

bottom-up DIB


function GetInterlaced: boolean;


function GetPalette: HPALETTE;

and (ColorMap.Count = 0); Why this?


function GetPixel(x, y: integer): BYTE;


function GetScanLine(Row: Integer): PChar;

Rewind and load DIB into bitmap


function GetVersion: TGIFVersion;


function HasMask: boolean;


procedure NewBitmap;


procedure NewImage;

Need to create new bitmap and repaint


function ScaleRect(DestRect: TRect): TRect;

Given a destination rect (DestRect) calculates the area covered by this sub image


procedure SetBitmap(Value: TBitmap);

OnProgress can raise EAbort to cancel image load


procedure SetBounds(Index: integer; Value: WORD);

To avoid compiler warnings


procedure SetInterlaced(Value: boolean);


procedure SetPalette(Value: HPalette);

Use global palette if everything else fails


procedure Compress(Stream: TStream);

raise GIFException.Create('Too much input data, ignoring extra...');


procedure Decompress(Stream: TStream);

Found empty slot - key doesn't exist


procedure Prepare;


Properties


property ActiveColorMap : TGIFColorMap


property Bitmap : TBitmap


property BitsPerPixel : integer


property BoundsRect : TRect


property ClientRect : TRect


property ColorMap : TGIFColorMap


property ColorResolution : integer


property Data : PChar


property DataSize : integer


property Empty : boolean


property Extensions : TGIFExtensionList


property GraphicControlExtension : TGIFGraphicControlExtension


property Height : WORD


property Interlaced : boolean


property Left : WORD


property Mask : HBitmap


property Palette : HPALETTE


property Pixels : BYTE


property Top : WORD


property Transparent : boolean


property Version : TGIFVersion


property Width : WORD


Events


Variables


FBitmap : TBitmap;


FColorMap : TGIFColorMap;


FData : PChar;


FDataSize : integer;


FDIBBits : pointer;


FDIBBitsSize : longInt;


FDIBInfo : PBitmapInfo;


FDIBInfoSize : integer;


FExtensions : TGIFExtensionList;


FGCE : TGIFGraphicControlExtension;


FImageDescriptor : TImageDescriptor;


FLocalPalette : HPalette;


FMask : HBitmap;


FNeedMask : boolean;


FTransparent : boolean;