The bitmap-file format

In order to avoid the time consuming enlargement or reduction of the pictures, there is the possibility of storing the pictures that have been brought to the right size already. You can set this with the two File-gadgets.

In order to always have the pictures ready in the various resolutions, the corresponding resolution of the printer (respectively that of the screen) is appended when storing. If you store the picture testpic in the previewer with a resolution of 91dpi, a file testpic.91x91 is created.

This file has a very special format. The first four bytes of the file are the `Magic Word' ``SPEC''. You can see from this, that it is a bitmap file of the SpecialHost program.

The next four bytes appear, when you add up the special-string that belongs to this file, character for character. This is useful for recognizing whether the special-string has changed since you have created the file. Is this the case, then the picture is recomputed and stored.

Now two longwords follow, which indicate the width and the height of the picture in pixels.

Finally, the bitmap comes, line for line. The length of a line is rounded upwards to 16 bits. Thus, for a line with 100 bit, you need seven 16-bit words.

Another piece of data is stored with the file. The date of creation. It is used to check, whether the IFF picture is younger then the bitmap file. Is this the case, then of course the bitmap must be recomputed, as the IFF picture has apparently changed.

By this comparison of the dates and by the checking of the
special-string it is made sure, that no obsolete bitmap file is used. So you can use the drawing mode Transfer picture in a file as the standard, without trouble. This way, a picture for a resolution has to be computed only once, and is always available after that as a file. The only thing, that can become a problem, is the memory, as the bitmap files are not stored compressed.