您的位置:首页 - C#
c# 把 颜色值Hex 转换为 Color
Assuming you mean the HTML type RGB codes (called Hex codes, such as #FFCC66), use theColorTranslator class:

System.Drawing.Color col = System.Drawing.ColorTranslator.FromHtml("#FFCC66");

If, however you are using an ARGB hex code, you can use the ColorConverter class from the System.Windows.Media namespace:

Color col = ColorConverter.ConvertFromString("#FFDFD991") as Color;
本站导航
相关文章
柯乐义 Copyright© keleyi.com