开发者

Can I get the RGB of a system color in C# without using pinvoke?

开发者 https://www.devze.com 2022-12-20 19:54 出处:网络
I want to determine the RGB color of a system color such as Sys开发者_Python百科temColors.HotTrack.

I want to determine the RGB color of a system color such as Sys开发者_Python百科temColors.HotTrack.

Is there a way to do this without resorting to using P/Invoke and GetSysColor (not including drawing into a bitmap and checking pixel values)?


byte r = SystemColors.HotTrack.R;
byte g = SystemColors.HotTrack.G;
byte b = SystemColors.HotTrack.B;

or

int argb = SystemColors.HotTrack.ToArgb();
0

精彩评论

暂无评论...
验证码 换一张
取 消