Silverlight/WPF 用十六进制颜色设置椭圆 [英] Silverlight/WPF sets ellipse with hexadecimal colour
本文介绍了Silverlight/WPF 用十六进制颜色设置椭圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在后面的代码中设置椭圆对象的颜色.到目前为止,我是通过使用 SolidColorBrush 方法来完成的.有没有办法像在 CSS 中那样以十六进制插入颜色值?
I am trying to set a colour of an ellipse object in code behind. So far I'm doing it by using the SolidColorBrush method. Is there a way to insert the colour value in hexadecimal, like in CSS?
这是我正在使用的代码:
Here is a code that I am using:
ellipse.Fill = new SolidColorBrush(Colors.Yellow);
推荐答案
我写了一个简单的颜色转换器功能 来解决这个问题.快乐的面孔实际上是数字 8 和括号,如下所示:8).
I wrote a simple color converter function to solve this problem. The happy faces are really the number 8 and a parentheses, like this: 8).
这篇关于Silverlight/WPF 用十六进制颜色设置椭圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文