Share via


Device.ColorFill(Surface,Rectangle,Color) 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 ColorLeave Site _
)
C# public void ColorFill(
    Surface surface,
    RectangleLeave Site rect,
    ColorLeave Site color
);
C++ public:
void ColorFill(
    Surfacesurface,
    RectangleLeave Site rect,
    ColorLeave Site color
);
JScript public function ColorFill(
    surface : Surface,
    rect : RectangleLeave Site,
    color : ColorLeave Site
);

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.Drawing.Color
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