Get Known Color from int value
I think you are confusing how the FromArgb method works. It takes a 32 bit number in the format AARRGGBB, where each element of the color is an 8 bit number of the value 0 to 255. Setting the color to zero creates a black color, but it is transparent (the alpha channel is zero). To set black with an
I think you are confusing how the FromArgb method works. It takes a 32 bit number in the format AARRGGBB, where each element of the color is an 8 bit number of the value 0 to 255. Setting the color to zero creates a black color, but it is transparent (the alpha channel is zero). To set black with an opaque color, you need to add 4278190080 to the value (0xFF000000), which is basically ORing 0xFF000000 with the desired color. You can either do that, or remember to set the Color.A channel to 255 after you call FromArgb() in your code.