Поделиться через


Source and Destination Rectangles (Windows Embedded CE 6.0)

1/6/2010

To display an overlay surface, you call the overlay surface's IDirectDrawSurface::UpdateOverlay method, specifying the DDOVER_SHOW flag in the dwFlags parameter.

The method requires you to specify a source and destination rectangle in the lpSrcRect and lpDestRect parameters. The source rectangle describes a rectangle on the overlay surface that will be visible on the primary surface.

To request that the method use the entire surface, set the lpSrcRect parameter to NULL. The destination rectangle describes a portion of the primary surface on which the overlay surface will be displayed.

Source and destination rectangles do not need to be the same size. You can often specify a destination rectangle smaller or larger than the source rectangle, and the hardware will shrink or stretch the overlay appropriately when it is displayed.

To successfully display an overlay surface, you might need to adjust the size and position of both rectangles. Whether this is necessary depends on the restrictions imposed by the device driver. For more information, see Boundary and Size Alignment and Minimum and Maximum Stretch Factors.

See Also

Concepts

Overlay Surfaces