Rx GIF etc

RX Library

Control Name Unit Class
GIF RxGIF TGIFFrame

Description:
TGIFImage supports reading and writing GIF compressed image data. The GIFImage object uses the data from an instance of a TGIFData object, which contains that actual GIF data source and is never modified. Each GIF image object may share this data source object with other instances of a GIF image that are copies of it, created by using the Assign method. The GIF data source does referencing counting for the GIF image objects that are linked to it

The properties of TGIFImage indicate the size and characteristics of the GIF image.

TGIFImage supports up to 256-colors GIF images versions 87a and 89a (you can determine version of loaded image by Version property), and supports graphic control extensions (multiple images, transparency) and comment extensions of GIF format. Plain text extensions are not supported.

Single image from GIF animation sequence can be accessible by the Frames property.

TGIFImage has an internal bitmaps for each frame that contains the GIF image. These internal images and the original data source of a GIF image are read only.

A TGIFImage object:

• Has no canvas (and thus it cannot draw onto a canvas). A TGIFImage object does implement the protected Draw method introduced in TGraphic. This means that it can draw itself. When TGIFImage contains multiple frames (animated GIF) the Draw method will be draw frame specified by FrameIndex property.

• Provides no access to the internal bitmap image that it creates for the GIF image.

• TGIFImage and TGIFFrame can be assign to TBitmap object and you can assign TBitmap object to the TGIFImage or TGIFFrame. So you can create TGIFImage, assign bitmap to it and then store image as GIF file by using SaveToFile method.


Property BackgroundColor
Declaration: BackgroundColor: TColor;

The BackgroundColor property determines which background color stored in the GIF file to use when drawing a GIF image. The background color is the color used for those pixels on the screen that are not covered by an image.


Property Comment
Declaration: Comment: TStrings;

This contains the comment text stored in comment extension of a GIF file.


Property Count
Declaration: Count: Integer;

This is a read-only property and for animated GIFs. It stores the number of frames contained within the GIF file.


Property FrameIndex
Declaration: FrameIndex: Integer;

This property contains the current frame being displayed. When this property is changed, it would change the frame being displayed on the canvas.


Property Frames[Index: Integer]
Declaration: Frames[Index: Integer]: TGIFFrame;

Procedure returns the GIF frame from the index. This is used to obtain (or extract) a particular frame from the GIF animated file.


Property Height
Declaration: Height: Integer;

Height specifies the vertical size in pixels of the current frame (specified by FrameIndex property) of the GIF image.


Property Palette
Declaration: Palette: HPALETTE;

Palette indicates the color palette of the graphical GIF image. Use Palette to get the color palette of a GIF image.


Property ScreenHeight
Declaration: ScreenHeight: Integer;

Logical screen height, in pixels, of the Logical Screen where the images will be rendered in the displaying device. Specifies the height of the space in which the animation plays. This value is a taller space for frames that move vertically.


Property ScreenWidth
Declaration: ScreenWidth: Integer;

Logical screen width, in pixels, of the Logical Screen where the images will be rendered in the displaying device. Specifies the width of the space in which the animation plays. This value is a wider space for frames that move horizontally.


Property TransparentColor
Declaration: TransparentColor: TColor;

TransparentColor determines which color of the GIF image is to be transparent when the GIF image is drawn.


Property Version
Declaration: Version: TGIFVersion;

Version number used to format the GIF data stream. Identifies the minimum set of capabilities necessary to a decoder to fully process the contents of the Data Stream. GIF version numbers can be one of following values:

  • gv87a - May 1987
  • gv89a - July 1989.

Property Width
Declaration: Width: Integer;

Width specifies the horizontal size in pixels of the current frame (specified by FrameIndex property) of the GIF image.


Event OnProgress
Declaration: OnProgress: TProgressEvent;

OnProgress occurs when a graphical image is in the process of changing. OnProgress is a generic progress indicator event that propagates out to the TGIFImage OnProgress events.


Type TDisposalMethod
Declaration: TDisposalMethod = (dmUndefined, dmLeave, dmRestoreBackground, dmRestorePrevious, dmReserved4, dmReserved5, dmReserved6, dmReserved7);

TDisposalMethod is the type of available values for the DisposalMethod property of the TGIFFrame object.


Type TGIFVersion
Declaration: TGIFVersion = (gvUnknown, gv87a, gv89a);

TGIFVersion defines the types of GIF file that can be read.


Property AnimateInterval
Declaration: AnimateInterval: Word;

Specifies the amount of time, in milliseconds, that the image displays during the animation.


Property Bitmap
Declaration: Bitmap: TBitmap;

An internal bitmap that contains the GIF frame's image. Protected.


Property DisposalMethod
Declaration: DisposalMethod: TDisposalMethod;

DisposalMethod indicates how frames display in the animation from the following choices:

• dmUndefined - Directs the viewer (animator) to do nothing to the background before displaying the next image.

• dmLeave - Directs the viewer to leave the previous graphic image as the next is drawn.

This choice can create a shadowing effect.

• dmRestoreBackground - Directs the viewer to redraw the original background as the current image is drawn.
• dmRestorePrevious - Directs the viewer to redraw the previous image as the current image is drawn


Property Height
Declaration: Height: Integer;

Height indicates the vertical size in pixels of the GIF-frame image.


Property Origin
Declaration: Origin: TPoint;

Origin indicates the position of the left and top edges of the image, with respect to the left edge of the Logical Screen. Leftmost column of the Logical Screen is 0. Top row of the Logical Screen is also 0.


Property TransparentColor
Declaration: TransparentColor: TColor;

TransparentColor is a color that will treat as the transparent portion of the GIF image.


Property Width
Declaration: Width: Integer;

Width indicates the horizontal size in pixels of the GIF-frame image.


Method Draw
Declaration: procedure Draw(ACanvas: TCanvas; X, Y: Integer);

Draw the GIF frame on the canvas specified by the ACanvas parameter at the location given by the coordinates (X, Y).


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000