ANI (file format)
This article needs additional citations for verification. (April 2024) |
Filename extension |
.ani |
---|---|
Internet media type | application/x-navi-animation |
Magic number | ACON (4 bytes, ASCII) |
Developed by | Microsoft |
Type of format | animated raster image format for mouse cursors[1] |
The ANI file format is a graphics file format used for animated mouse cursors on the Microsoft Windows operating system.[2]
The format is based on the Microsoft Resource Interchange File Format, which is used as a container for storing the individual frames (which are standard Windows icons) of the animation.
File structure
[edit]The RIFF file structure description:
#define AF_ICON 0x1 // Windows format icon/cursor animation. #define AF_SEQUENCE 0x2 // Animation is sequenced. typedef struct { DWORD cbSizeof; // Should be sizeof(ANIHEADER) = 36 bytes. DWORD cFrames; // Count of frames in animation. DWORD cSteps; // Number of steps in the cursor. DWORD cx, cy; // Not used when AF_ICON is set. DWORD cBitCount, cPlanes; // Not used when AF_ICON is set. DWORD jifRate; // Default display rate, in jiffies (1/60s). DWORD fl; // AF_ICON should be set. AF_SEQUENCE is optional. } ANIHEADER; RIFF('ACON' [LIST('INFO' [INAM(<ZSTR>)] // Cursor title. Optional. [IART(<ZSTR>)] // Author name. Optional. )] 'anih'(<ANIHEADER>) // ANI file header. ['rate'(<DWORD...>)] // Rate table (array of jiffies). // If the AF_SEQUENCE flag is set // then the count is ANIHEADER.cSteps, // otherwise ANIHEADER.cFrames. ['seq '(<DWORD...>)] // 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'(<icon_data_1>) // Frame 1 'icon'(<icon_data_2>) // 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 cursor, the sequence will loop. There is no way of influencing that behavior[3].
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[4].
See also
[edit]References
[edit]- ^ "Details for: Microsoft Animated Cursor Format". The National Archives. Retrieved April 1, 2025.
- ^ "ANI File - What is an .ani file and how do I open it?". fileinfo.com. Retrieved 2024-04-27.
- ^ "file-format-ani". www.daubnet.com. Retrieved 2025-05-03.
- ^ "MSDN Library October 2001 - Internet Archive". archive.org. Retrieved 2025-05-03.