Color32[] GetPixels32()

robot_2Generated
code_blocksInput

Description

Retrieves the pixel data of the bitmap as an array of Color32 objects. This method provides a way to access the color information of each pixel in the bitmap, represented in 32-bit color format.

Usage

To use the GetPixels32 method, simply call it on an instance of the Bitmap class. This will return an array of Color32 objects, each representing the color of a pixel in the bitmap.

Example

// Example usage of GetPixels32
Bitmap bitmap = new Bitmap();
Color32[] pixels = bitmap.GetPixels32();

// Iterate through the pixels
foreach (Color32 color in pixels)
{
    // Process each color
    // Example: Print the color values
    Console.WriteLine($"R: {color.r}, G: {color.g}, B: {color.b}, A: {color.a}");
}