2.2.2.2.1.3.5.1 Stream Bitmap First (STREAM_BITMAP_FIRST_ORDER)

The Stream Bitmap First Alternate Secondary Drawing Order is used by the server to send the client the first block in a streamed bitmap and information describing the bitmap (such as color depth, width, and height).


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

header

BitmapFlags

BitmapBpp

BitmapType

...

BitmapWidth

BitmapHeight

...

BitmapSize (variable)

...

BitmapBlockSize

BitmapBlock (variable)

...

header (1 byte): An Alternate Secondary Order Header, as specified in section 2.2.2.2.1.3.1.1. The embedded orderType field MUST be set to TS_ALTSEC_STREAM_BITMAP_FIRST (0x02).

BitmapFlags (1 byte): An 8-bit, unsigned integer. Flags describing the order contents and layout.

Value

Meaning

STREAM_BITMAP_END

0x01

Indicates that the bitmap fits into one stream bitmap block (4,096 bytes).

STREAM_BITMAP_COMPRESSED

0x02

Indicates that the bitmap data is compressed.

STREAM_BITMAP_REV2

0x04

Indicates that the BitmapSize field is 4 bytes. If this flag is not set, the BitmapSize field is 2 bytes.

BitmapBpp (1 byte): An 8-bit, unsigned integer. The color depth in bits per pixel of the streamed bitmap.

BitmapType (2 bytes): A 16-bit, unsigned integer. The type of the streamed bitmap.

Value

Meaning

TS_DRAW_NINEGRID_BITMAP_CACHE

0x0001

Indicates that the data in the BitmapBlock field is a NineGrid source bitmap.

BitmapWidth (2 bytes): A 16-bit, unsigned integer. The width in pixels of the streamed bitmap.

BitmapHeight (2 bytes): A 16-bit, unsigned integer. The height in pixels of the streamed bitmap.

BitmapSize (variable): A variable-length field containing the total size in bytes of the streamed bitmap. If the STREAM_BITMAP_REV2 (0x04) flag is set in the BitmapFlags field, this field MUST contain a 32-bit unsigned integer. If the STREAM_BITMAP_REV2 flag is not set, this field MUST contain a 16-bit unsigned integer.

BitmapBlockSize (2 bytes): A 16-bit, unsigned integer. The size in bytes of the bitmap stream data block contained in the BitmapBlock field. This value MUST be less than or equal to the value contained in the BitmapSize field; if the STREAM_BITMAP_END (0x01) flag is set in the BitmapFlags field, the two values MUST be equal.

BitmapBlock (variable): A variable-length byte array. The first block of the streamed bitmap (also the last if the STREAM_BITMAP_END (0x01) flag is set in the BitmapFlags field). The size of this block is given by the BitmapBlockSize field.