Rx ANI file

RX Library

Control Name Unit Class
RX ANI File. AniFile TAnimatedCursorImage

Description:
The TAnimatedCursorImage object encapsulates the data loaded from a Windows animated cursor (.ANI) file.

(An ANI file is a file that contains a list of icons that animate during run-time)

To load an ANI cursor image from a file, call the LoadFromFile method. To retrieve a single image as an icon by its index from the list after loading, use the Icons and IconCount properties.

You can also assign the images from the animated cursors to the bitmap that consists of a series of frames arranged one after other by using the AssignToBitmap method.

To extract the copyright information, utilise the property
Creator and the title property to obtain the description of what the ANI file is about. To control the speed of the rate of animation, use the default rate property. If your background is of some other colour or you would like your ANI file to be background transparent, use the original colours property to tweak the background colour.

See also:
RX Animate (TAnimatedImage) and RX Gif Animator (TRxGIFAnimator).


Property Creator
Declaration: Creator: string;

After loading ANI cursor file into the TAnimatedCursorImage object, the Creator property contains the information about the author that produced the file or some another copyright information.


Property DefaultRate
Declaration: DefaultRate: Longint;

The DefaultRate property determines the amount of time in milliseconds that passes among frames of a TAnimatedCursorImage animation. This value is read from .ANI file and is equal to the duration of first cursor's image.


Property IconCount
Declaration: IconCount: Integer;

IconCount is read only and contains the number of icons in a list after loading ANI data from a ANI Cursor file.


Property Icons[Index: Integer]
Declaration: Icons[Index: Integer]: TIcon;

The Icons property allows you to access a specific icon inside the icon list after loading the data from the .ANI file.


Property OriginalColors
Declaration: OriginalColors: Word;

Read only. The OriginalColors determines in what bit format (color count) the cursor images are stored in the animated cursor file.

The OriginalColors will always be one of the specified value: 2 (monochrome icons), 16 (16-colors icons), 256 (256-colors icons) or 0 (true-color or high-color icons).


Property Title
Declaration: Title: string;

The Title property stores the description of the ANI file.


Method AssignToBitmap
Declaration: procedure AssignToBitmap(Bitmap: TBitmap; BackColor: TColor; DecreaseColors, Vertical: Boolean);

The procedure AssignToBitmap discards any current image in Bitmap object and replaces the icon's images loaded from ANI-file. The resulting image is a series of frames arranged one after the other according to the Vertical parameter value. To make resulted image partially transparent you could use the BackColor parameter. Also you could use DecreaseColors property to decrease bitmap color count to the original value described in the ANI-file.


Method LoadFromFile
Declaration: procedure LoadFromFile(const Filename: string); virtual;

The LoadFromFile method reads the animated cursor file specified in FileName and loads the icons into the TAnimatedCursorImage object.


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