我怎样才能得到一个 Brush
来设置背景,例如来自 RGB 代码的 Grid
。
我将 RGB 代码作为 int
:
R = 12
B = 0
G = 255
我需要知道如何将它转换成Brush
最佳答案
var brush = new SolidColorBrush(Color.FromArgb(255, (byte)R, (byte)G, (byte)B));
myGrid.Background = brush;
关于c# - 如何从 RGB 代码中获取画笔?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16240581/