The information in this article applies to:
SUMMARYThis article provides the format of Windows Paintbrush files. MORE INFORMATIONPaintbrush files are preceded by 32 bytes of header information. Following the header is an index table into run-length encoded data. HeaderThe header structure is defined in the C programming language, as follows:
The first 32 bytes contain the header information described by the
above structure:
IndexThe Paintbrush bitmap is run-length encoded. Each scan line is encoded separately. The length of the resulting encoded string depends on the pattern of the bitmap. There is an index table following the header. Each entry of this index corresponds to a scan line. It is an unsigned integer and shows the length of the encoded data. Following this table is the encoded data.
ALGORITHM FOR ENCODINGPaint encoding is read in BYTES. There are two types of encoded data: one starts with 0 (zero), the other starts with a nonzero value.If the data starts with 0, it is a repeated byte pattern. The byte following the 0 tells how many times to repeat the pattern and the subsequent byte is the pattern itself. For example, 0, 0x80, 0xff, should be expanded to eighty (hex) bytes of 0xff. If the data starts with a nonzero value, X, the following X number of bytes contain unmodified bitmap data, without recognizable pattern. Each scan line can be composed of several of the above mentioned groups of data. Of course, the groups should alternate, meaning that a scan line can start with a repeated pattern followed by some random pattern, which is followed by another repeated pattern. To reach the data for the nth scan line, add up the values in the index table from entry 0 to entry n - 1. Additional query words: 3.00 no32bit 3.10
Keywords : kb16bitonly |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |