Device.UpdateSurface Method

Language:

Copies rectangular subsets of pixels from one surface to another.

Definition

Visual Basic Public Sub UpdateSurface( _
    ByVal sourceSurface As Surface, _
    ByVal sourceRect As Rectangle, _
    ByVal destinationSurface As Surface _
)
C# public void UpdateSurface(
    Surface sourceSurface,
    Rectangle sourceRect,
    Surface destinationSurface
);
C++ public:
void UpdateSurface(
    SurfacesourceSurface,
    Rectangle sourceRect,
    SurfacedestinationSurface
);
JScript public function UpdateSurface(
    sourceSurface : Surface,
    sourceRect : Rectangle,
    destinationSurface : Surface
);

Parameters

sourceSurface Microsoft.DirectX.Direct3D.Surface
A Surface object that represents the source surface; must point to a surface other than destinationSurface.
sourceRect System.Drawing.Rectangle
A Rectangle Leave Site object that represents the rectangle on the source surface. Specifying null for this parameter causes the entire surface to be copied.
destinationSurface Microsoft.DirectX.Direct3D.Surface
A Surface object that represents the destination surface.

Remarks

This method has the following restrictions.

The following table shows the supported format combinations.

Destination format
Source format Texture RT texture RT Off-screen plain
Texture Yes Yes Yes* Yes
RT texture No No No No
RT No No No No
Off-screen plain Yes Yes Yes Yes

* If the driver does not support the requested copy, it is emulated using locking and copying.

If the application needs to copy data from a Pool.Default render target to a Pool.SystemMemory surface, it can use Device.GetRenderTargetData.

Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value.


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center