Mapping Mode Conversions

The BitBlt call requires different starting coordinates for the source and destination device contexts, but it needs only one width and one height:

BitBlt (hdcDest, xDest, yDest, xWidth, yHeight,

hdcSrc, xSrc, ySrc, dwROP) ;

The xWidth and yHeight values are in logical units, and they apply to both the rectangle in the source device context and the rectangle in the destination device context. BitBlt must convert all coordinates and sizes to device coordinates before calling on the driver file to perform the actual operation. Because the xWidth and yHeight values are used for both the source and destination device contexts, the values must be converted to device units (pixels) separately for each device context.

When the source and destination device contexts are the same, or when both device contexts use the MM_TEXT mapping mode, then the size of this rectangle in device units will be the same in both device contexts. Windows can then do a simple pixel-to-pixel transfer. However, when the size of the rectangle in device units is different in the two device contexts, Windows turns the job over to the more versatile StretchBlt function.