Microsoft DirectX 8.1 (C++) |
When using the IDirect3DDevice8::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.
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: //-d3dDevice is a valid Direct3DDevice8 object. //-pSource and pDest are valid IDirect3DSurface8 pointers. RECT rcSource[] = { 0, 0, 50, 50, 50, 50, 100, 100 }; POINT ptDest[] = { 0, 0, 150, 150 }; d3dDevice->CopyRect( pSource, rcSource, 2, pDest, ptDest);
The following methods are also available in C++/C for copying images to a Microsoft® Direct3D® surface.