2.2.2.2.1.1.2.10 Mem3Blt (MEM3BLT_ORDER)

The Mem3Blt Primary Drawing Order is used to render a bitmap stored in the bitmap cache or offscreen bitmap cache to the screen by using a specified brush and three-way raster operation.

 Encoding order number: 14 (0x0E)
 Negotiation order number: 4 (0x04)
 Number of fields: 16
 Number of field encoding bytes: 3
 Maximum encoded field length: 34 bytes


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

cacheId (optional)

nLeftRect (variable)

nTopRect (variable)

nWidth (variable)

nHeight (variable)

bRop (optional)

nXSrc (variable)

...

nYSrc (variable)

BackColor (optional)

...

ForeColor (optional)

...

BrushOrgX (optional)

BrushOrgY (optional)

BrushStyle (optional)

BrushHatch (optional)

BrushExtra (optional)

...

cacheIndex (optional)

cacheId (2 bytes): A 16-bit, unsigned integer. The cacheId field contains the encoded bitmap cache ID and Color Table Cache entry. The high byte contains the index of the color table entry to use (cached previously with a Cache Color Table (section 2.2.2.2.1.2.4) Secondary Drawing Order), and the low byte contains the ID of the bitmap cache in which the source bitmap is stored (cached previously with a Cache Bitmap - Revision 1 (section 2.2.2.2.1.2.2) or Cache Bitmap - Revision 2 (section 2.2.2.2.1.2.3) Secondary Drawing Order).

The color table entry MUST be in the range 0 to 5 (inclusive).

If the client advertised support for the Revision 1 bitmap caches (section 3.1.1.1.1) by sending the server the Revision 1 Bitmap Cache Capability Set ([MS-RDPBCGR] section 2.2.7.1.4.1), then the cache ID MUST be in the range 0 to 2 (inclusive). However, if the client advertised support for the Revision 2 bitmap caches (section 3.1.1.1.1) by sending the server the Revision 2 Bitmap Cache Capability Set ([MS-RDPBCGR] section 2.2.7.1.4.2), then the cache ID MUST be greater than or equal to 0 and less than the number of bitmap caches being used for the connection (specified by the NumCellCaches field of the Revision 2 Bitmap Cache Capability Set).

If the bitmap cache ID is set to TS_BITMAPCACHE_SCREEN_ID (0xFF), the cacheIndex field MUST contain the index of an entry in the Offscreen Bitmap Cache that contains the source bitmap.

nLeftRect (variable): The left coordinate of the blit rectangle specified by using a Coord Field (section 2.2.2.2.1.1.1.1).

nTopRect (variable): The top coordinate of the blit rectangle specified by using a Coord Field (section 2.2.2.2.1.1.1.1).

nWidth (variable): The width of the blit rectangle specified by using a Coord Field (section 2.2.2.2.1.1.1.1).

nHeight (variable): The height of the blit rectangle specified by using a Coord Field (section 2.2.2.2.1.1.1.1).

bRop (1 byte): The index of the ternary raster operation to perform (see section 2.2.2.2.1.1.1.7).

nXSrc (variable): The x-coordinate of the source rectangle within the source bitmap specified by using a Coord Field (section 2.2.2.2.1.1.1.1).

nYSrc (variable): The inverted y-coordinate of the source rectangle within the source bitmap specified using a Coord Field (section 2.2.2.2.1.1.1.1). The actual value of the y-coordinate MUST be computed using the following formula:

 ActualYSrc = (SourceBitmapHeight - nHeight) - nYSrc

BackColor (3 bytes): Background color described by using a Generic Color (section 2.2.2.2.1.1.1.8) structure.

ForeColor (3 bytes): Foreground color described by using a Generic Color (section 2.2.2.2.1.1.1.8) structure.

BrushOrgX (1 byte): An 8-bit, signed integer. The x-coordinate of the point where the top leftmost pixel of a brush pattern MUST be anchored.

BrushOrgY (1 byte): An 8-bit, signed integer. The y-coordinate of the point where the top leftmost pixel of a brush pattern MUST be anchored.

BrushStyle (1 byte): An 8-bit, unsigned integer. The contents and format of this field are the same as the BrushStyle field of the PatBlt (section 2.2.2.2.1.1.2.3) Primary Drawing Order.

BrushHatch (1 byte): An 8-bit, unsigned integer. The contents and format of this field are the same as the BrushHatch field of the PatBlt (section 2.2.2.2.1.1.2.3) Primary Drawing Order.

BrushExtra (7 bytes): The contents and format of this field are the same as the BrushExtra field of the PatBlt (section 2.2.2.2.1.1.2.3) Primary Drawing Order.

cacheIndex (2 bytes): A 16-bit, unsigned integer. The index of the source bitmap within the bitmap cache specified by the cacheId field.

If this field is set to BITMAPCACHE_WAITING_LIST_INDEX (32767), the last bitmap cache entry MUST contain the bitmap data. Otherwise, this field MUST contain a value that is greater than or equal to 0 and less than the maximum number of entries allowed in the source bitmap cache. If the client advertised support for the Revision 1 bitmap caches (section 3.1.1.1.1) by sending the server the Revision 1 Bitmap Cache Capability Set ([MS-RDPBCGR] section 2.2.7.1.4.1), then the maximum number of entries allowed in each individual Revision 1 bitmap cache is specified in the Revision 1 Bitmap Cache Capability Set by the Cache0Entries, Cache1Entries and Cache2Entries fields. If the client advertised support for the Revision 2 bitmap caches (section 3.1.1.1.1) by sending the server the Revision 2 Bitmap Cache Capability Set ([MS-RDPBCGR] section 2.2.7.1.4.2), then the maximum number of entries allowed in each individual Revision 2 bitmap cache is specified in the Revision 2 Bitmap Cache Capability Set ([MS-RDPBCGR] section 2.2.7.1.4.2) by the BitmapCache0CellInfo, BitmapCache1CellInfo, BitmapCache2CellInfo, BitmapCache3CellInfo and BitmapCache4CellInfo fields.

If the bitmap cache ID (specified in the cacheId field) is set to TS_BITMAPCACHE_SCREEN_ID (0xFF), this field MUST contain the index of an entry in the Offscreen Bitmap Cache that contains the source bitmap.