void Clear( Color color )

book_4_sparkGenerated
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, overwriting any existing pixel data.

Usage

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

Example

// Create a new Bitmap instance
Bitmap bitmap = new Bitmap();

// Define a color to clear the bitmap with
Color clearColor = new Color(255, 0, 0, 255); // Red color

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