The ANI file format is a
graphics file format
An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be c ...
used for
animated
Animation is a filmmaking technique whereby image, still images are manipulated to create Motion picture, moving images. In traditional animation, images are drawn or painted by hand on cel, transparent celluloid sheets to be photographed and e ...
mouse cursors on the
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
.
The format is based on the Microsoft
Resource Interchange File Format
Resource Interchange File Format (RIFF) is a generic file container format (digital), container format for storing data in tagged Chunk (information), chunks. It is primarily used for audio and video, though it can be used for arbitrary data.
T ...
, which is used as a
container
A container is any receptacle or enclosure for holding a product used in storage, packaging, and transportation, including shipping.
Things kept inside of a container are protected on several sides by being inside of its structure. The term ...
for storing the individual frames (which are standard
Windows icons) of the animation.
File structure
The
RIFF
A riff is a short, repeated motif or figure in the melody or accompaniment of a musical composition. Riffs are most often found in rock music, punk, heavy metal music, Latin, funk, and jazz, although classical music is also sometimes based ...
file structure description:
#define AF_ICON 0x1 // Frames are in Windows ICO format.
#define AF_SEQUENCE 0x2 // Animation is sequenced.
typedef struct ANIHEADER;
RIFF('ACON'
)">IST('INFO'
[INAM() // Title. Optional.
[IART()">NAM(<ZSTR>).html" ;"title="IST('INFO'
[INAM()">IST('INFO'
[INAM() // Title. Optional.
[IART() // Author. Optional.
)]
'anih'() // ANI file header.
['rate'()] // Rate table (array of jiffies).
// If the AF_SEQUENCE flag is set
// then the count is ANIHEADER.cSteps,
// otherwise ANIHEADER.cFrames.
)">seq '() // Sequence table (array of frame index values).
// Should be present when AF_SEQUENCE flag is set.
// Count is ANIHEADER.cSteps.
LIST('fram' // List of frames data. Count is ANIHEADER.cFrames.
'icon'() // Frame 1
'icon'() // Frame 2
...
)
)
Individual frames are in
ICO format.
Frame rates are measured in
jiffies, with one jiffy equal to 1/60 of a second, or 16.666 ms.
Sequence information present in the file determines the sequence of frames, and allows frames to be played more than once, or in a different order than that in which they appear in the file. For example, if the animation contains three different images numbered 1, 2 and 3, and the sequence is 1-2-3-2-1, (five frames) then only three icons need to be stored in the file, thereby saving storage space.
If an ANI file is used as
Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
cursor, the sequence will loop. There is no way of influencing that behavior.
Animated Cursor Editor for Windows NT (ANIEDIT) source code from MSDN October 2001 Library is a good source of knowledge about ANI file format structure.
See also
*
Pointer (user interface)
In human–computer interaction, a cursor is an indicator used to show the current position on a computer monitor or other display device that will respond to input, such as a text cursor or a mouse pointer.
Etymology
''Cursor'' is Latin for ...
*
ICO (file format)
The ICO file format is an image file format for computer icons in Microsoft Windows. ICO files contain one or more small images at multiple sizes and color depths, such that they may be scaled appropriately. In Windows, all executables that d ...
References
External links
Description of the ani file formatIntroduce Animated Cursors to Java GUIs, Part 2Vulnerability in Windows Animated Cursor Handling
Graphics file formats
Windows architecture
{{windows-stub