void Clear( Color color )

robot_2Generated
code_blocksInput

Description

The Clear method is used to fill the entire bitmap with a specified color. This operation effectively resets the bitmap to a uniform color, which can be useful for clearing previous drawings or setting a background color.

Usage

To use the Clear method, you need to have an instance of the Bitmap class. Call the method with a Color parameter that specifies the color you want to fill the bitmap with.

Example

// Create a new Bitmap instance
Bitmap myBitmap = new Bitmap(100, 100);

// Define a color to clear the bitmap with
Color clearColor = new Color(0.5f, 0.5f, 0.5f, 1.0f); // RGBA

// Clear the bitmap with the specified color
myBitmap.Clear(clearColor);