Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎样才能从 RGB 代码Brush中设置例如 a 的背景。Grid
Brush
Grid
我将 RGB 代码作为int:
int
R = 12 B = 0 G = 255
我需要知道如何将其转换为Brush
var brush = new SolidColorBrush(Color.FromArgb(255, (byte)R, (byte)G, (byte)B)); myGrid.Background = brush;