Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从RGB代码中获取画笔?_C#_Windows Runtime - Fatal编程技术网

C# 如何从RGB代码中获取画笔?

C# 如何从RGB代码中获取画笔?,c#,windows-runtime,C#,Windows Runtime,如何获取画笔以从RGB代码设置背景,例如网格 我将RGB代码设置为int: R = 12 B = 0 G = 255 我需要知道如何将其转换为画笔,但这需要有字节作为输入。你比我更了解它:p itsSolidBrushthough@Sayse它是?在WinRT中,它是SolidColorBrush。在WinForms中,它是SolidBrush@ChrisSinclair,你发布的链接是WPF的。正确的链接是啊,我还没有冒险进入RT,但很高兴知道:DTOP在他的标签中提到WinRT var b

如何获取
画笔
以从RGB代码设置背景,例如
网格

我将RGB代码设置为int

R = 12
B = 0
G = 255

我需要知道如何将其转换为
画笔

,但这需要有字节作为输入。你比我更了解它:p its
SolidBrush
though@Sayse它是?在WinRT中,它是SolidColorBrush。在WinForms中,它是SolidBrush@ChrisSinclair,你发布的链接是WPF的。正确的链接是啊,我还没有冒险进入RT,但很高兴知道:DTOP在他的标签中提到WinRT
var brush = new SolidColorBrush(Color.FromArgb(255, (byte)R, (byte)G, (byte)B));
myGrid.Background = brush;