Microsoft DirectX 9.0 SDK Update (October 2004)

Device.ColorFill Method

Language:

Note: This documentation is preliminary and is subject to change.

Allows an application to fill a rectangular area of a Default surface with a specified color.

Definition

Visual Basic .NET Public Sub ColorFill( _
    ByVal surface As Surface, _
    ByVal rect As Rectangle, _
    ByVal color As Integer _
)
C# public void ColorFill(
    Surface surface,
    Rectangle rect,
    int color
);
Managed C++ public: void ColorFill(
    Surface *surface,
    Rectangle rect,
    int color
);
JScript .NET public function ColorFill(
    surface : Surface,
    rect : Rectangle,
    color : int
);

Parameters

surface Microsoft.DirectX.Direct3D.Surface. Surface to be filled.
rect System.Drawing.Rectangle. Source rectangle. To fill the entire surface, specify null.
color System.Int32. Color used for filling.

Remarks

This method can be applied only to a render target, a render-target texture surface, or an off-screen plain surface with a pool type of Default.

Device.ColorFill works with all formats. However, when using a reference or a software device, the only formats supported are X1R5G5B5, A1R5G5B5, R5G6B5, X8R8G8B8, A8R8G8B8, YUY2, G8R8G8B8, UYVY, R8G8B8G8, R16F, G16R16F, A16B16G16R16F, R32F, G32R32F, and A32B32G32R32F.

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

See Also


© 2004 Microsoft Corporation. All rights reserved. Terms of use.

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