Share via


Device.ColorFill(Surface,Rectangle,Int32) Method (Microsoft.DirectX.Direct3D)

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

Definition

Visual Basic Public Sub ColorFill( _
    ByVal surface As Surface, _
    ByVal rect As RectangleLeave Site, _
    ByVal color As Integer _
)
C# public void ColorFill(
    Surface surface,
    RectangleLeave Site rect,
    int color
);
C++ public:
void ColorFill(
    Surfacesurface,
    RectangleLeave Site rect,
    int color
);
JScript public function ColorFill(
    surface : Surface,
    rect : RectangleLeave Site,
    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