Previous: 4.51.2.3.4. getHeight() To the Table of Contents Next: 4.51.2.3.6. getWidth()
4.51.2.3.4. getHeight() Table of Contents 4.51.2.3.6. getWidth()

- 4.51.2.3.5. -
Table of Contents
4. Standard Units
4.51. ObjGfx40 - ObjectGraphics 4.0 Unit
4.51.2. ObjGfx40 Unit Object Types
4.51.2.3. ogSprite object
4.51.2.3.5. getSize()


4.51.2.3.5. getSize()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Retrieves the size of the sprite.

Declaration:
 function getSize:uInt32; virtual;
Remarks:

Returns the size of the image as it would take on disk. This includes all header related information (width/height, bitdepth, pixel format, etc), an extra sizeof(uInt32) bytes for storing the complete size, followed by the sprite data. This allows easy indexing of sprites, since you can figure out exactly how much the sprite will take up on disk. This function computes the size in the exact order it is on disk. If the image is 8bpp, then there is a 768 byte palette stored after the sprite data along with an extra sizeof(uInt32) bytes for the palette size in bytes. Currently the entire palette is stored, but in a future revision palette optimization might occur so only used entries are stored.

If you were to store a single sprite in a file, getSize() would equal the filesize.

Returns:

Total size of the sprite, or 0 if no sprite data.

See also:







Previous: 4.51.2.3.4. getHeight() To the Table of Contents Next: 4.51.2.3.6. getWidth()
4.51.2.3.4. getHeight() Table of Contents 4.51.2.3.6. getWidth()

- 4.51.2.3.5. -