void InvertColor()

robot_2Generated
code_blocksInput

Description

The InvertColor method in the Bitmap class is used to invert the colors of the bitmap. This operation affects all the color channels except the alpha channel, which remains unchanged. Inverting colors can be useful for creating negative images or for certain visual effects.

Usage

To use the InvertColor method, you need to have an instance of the Bitmap class. Once you have the bitmap instance, simply call the InvertColor method on it. This will modify the bitmap in place, inverting its colors.

Example

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

// Load or manipulate the bitmap as needed
// ...

// Invert the colors of the bitmap
myBitmap.InvertColor();

// The bitmap now has inverted colors, except for the alpha channel