How can I convert an uint value to an ARGB System.Drawing.Color? I haven't found this on the internet yet...
I have just found methods for ARGB to uint.
My uint value came from:
uint aeroColor;
Dwmapi.DwmGetColorizationColor( out aeroColor, out opaque );
What does the uint represent? In general, you can use this:
Color c = Color.FromArgb(intvalue);
Using the appropriate overload. However, this expects an int, not a uint. If you have a uint with the same memory layout (as in your case) then the following should work:
uint aeroColor;
Dwmapi.DwmGetColorizationColor(out aeroColor, out opaque);
Color c = Color.FromArgb((int) aeroColor);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With