I am not trying to convert brush to string, but brush array to string.
I need to write a txt file on xml and then I am trying to convert a brush[]
into a string
, but I do not know how to this directly.
So, I tried to convert first to color
and then I would convert color
to string
.
I am struggling with the first conversion where the code is not allowing me to write this part:
Color[] cor1_local = new Pen(cor_local[i]).Color[];
cor_local
is brush[]
.
Code:
xml.WriteStartElement("cor_frmlocal");
for (int i = 0; i < cor_local.Length; i++)
{
Color[] cor1_local = new Pen(cor_local[i]).Color[];
xml.WriteElementString("Cor_local", cor1_local[i].ToArgb().ToString());
}
xml.WriteEndElement();