Partager via


Copying To Direct3D Mobile Surfaces (Windows Embedded CE 6.0)

1/6/2010

When using the IDirect3DMobileDevice::CopyRects method, you pass an array of rectangles on the source surface or NULL to specify the entire surface. You also pass an array of points on the destination surface to which the top-left position of each rectangle on the source image is copied. This method does not support clipping. The operation will fail unless all the source rectangles and their corresponding destination rectangles are completely contained within the source and destination surfaces respectively. This method does not support alpha blending, color keys, or format conversion. Note that the destination and source surfaces must be distinct.

CopyRects Example

The following example copies two rectangles from the source surface to a destination surface. The first rectangle is copied from (0, 0, 50, 50) on the source surface to the same location on the destination surface, and the second rectangle is copied from (50, 50, 100, 100) on the source surface to (150 ,150, 200, 200) on the destination surface.

//The following assumptions are made:
//-d3dmDevice is a valid Direct3DMobileDevice object.
//-pSource and pDest are valid IDirect3DMobileSurface pointers.

RECT  rcSource[] = {  0,  0,  50,  50,
                     50, 50, 100, 100 };
POINT ptDest[]   = {  0,  0, 150, 150 };

d3dmDevice->CopyRect( pSource, rcSource, 2, pDest, ptDest);

See Also

Concepts

Surfaces