ulCompression (ULONG)
BCA_UNCOMP
Encoding a run length:
Run-length encoded bit maps are encoded in the buffer in a controlled format. In all cases, if the first byte is non-zero, it is the length of a run of pels of a particular color or, in the case of a BCA_RLE4 bit map, a run of a length of pels of alternating colors.
1st-byte pel repetition count >= 1 2nd-4th bytes (BCA_RLE24 only) RGB value of pel. 2nd-byte (BCA_RLE8) color index of pel to be repeated (BCA_RLE4) the second byte contains 2 4-bit color indexes. The repetition count is completed by alternately choosing the high-order nibble followed by the low-order nibble for the succeeding pels until the count is exhausted.
Unencoded run:
An unencoded run is a string of pels to be placed in consecutive positions in the destination bit map.
1st-byte 0 2nd-byte COUNT = a multiple of 3 for BCA_RLE24 bit maps, or COUNT >= 3 (for BCA_RLE4 and BCA_RLE8 bit maps).
followed by the bytes as follows:
BCA_RLE24
A delta record indicates a shift in position in the destination bit map before the next record is decoded.
1st-byte 0 2nd-byte 2 3rd-byte Delta-x (unsigned) 4th-byte Delta-y (unsigned)
This is a relative jump record. It implies that the next record is to be decoded into a position in the destination bit map at an offset from the current position, determined by changing the horizontal and vertical positions by Delta-x and Delta-y, respectively.
End-of-line record:
The end-of-line record signifies that the data for the current scan line is complete and that decoding of the next record should begin at the start of the next scan line.
1st-byte 0 2nd-byte 0
End-of-RLE record:
The end-of-RLE record signifies the end of the data in the RLE compressed bit map.
1st-byte 0 2nd-byte 1