问题的目的是什么?是否可以在普通的XAML中执行此操作?XAML确实采用十六进制代码.
<Grid Background="#FFB800">
Run Code Online (Sandbox Code Playgroud)
否则在代码隐藏中我在Windows 8应用程序中使用了或多或少的以下内容:
var hexCode = "#FFFFB800";
var color = new Color();
color.A = byte.Parse(hexCode.Substring(1, 2), NumberStyles.AllowHexSpecifier);
color.R = byte.Parse(hexCode.Substring(3, 2), NumberStyles.AllowHexSpecifier);
color.G = byte.Parse(hexCode.Substring(5, 2), NumberStyles.AllowHexSpecifier);
color.B = byte.Parse(hexCode.Substring(7, 2), NumberStyles.AllowHexSpecifier);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2779 次 |
| 最近记录: |