Description
The Adjust
method of the Bitmap
class allows you to modify the visual properties of a bitmap image by adjusting its brightness, contrast, saturation, and hue. This method is useful for enhancing or altering the appearance of an image to meet specific visual requirements.
Usage
To use the Adjust
method, you need to have an instance of the Bitmap
class. You can then call the method with the desired parameters for brightness, contrast, saturation, and hue. Each parameter is a float
value that represents the level of adjustment you want to apply:
brightness
: A float
value where 0 means no change, negative values decrease brightness, and positive values increase brightness.
contrast
: A float
value where 0 means no change, negative values decrease contrast, and positive values increase contrast.
saturation
: A float
value where 0 means no change, negative values decrease saturation, and positive values increase saturation.
hueDegrees
: A float
value representing the degree of hue rotation. Positive values rotate the hue clockwise, and negative values rotate it counterclockwise.
Example
// Create a new Bitmap instance
Bitmap bitmap = new Bitmap();
// Adjust the bitmap's properties
// Increase brightness by 0.2, contrast by 0.5, saturation by 0.3, and rotate hue by 45 degrees
bitmap.Adjust(0.2f, 0.5f, 0.3f, 45.0f);