c#:color [] to brush []

时间:2015-10-15 19:55:19

标签: c# colors brush

如何将color []转换为brush []?我试过了:

for (int i = 0; i < cor3_local.length; i++)
{
Brush cor_local = new SolidBrush(cor3_local[i]);
}

但是cor_local没有值。

cor3_local是彩色[5]。

1 个答案:

答案 0 :(得分:3)

var brushes = cor3_local.Select(c => new SolidBrush(c)).ToArray();