The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I''m attempting to use the BackgroundColor.WriteXML to write out the current setting of a panel but I''m getting nothing - stream length of zero. Here''s a code sample :
MemoryStream strOutput = new MemoryStream();
System.Xml.XmlTextWriter writer = new XmlTextWriter(strOutput, null);
this.BackgroundColor = new BrushInfo(Color.Purple);
this.brush.WriteXml(writer);
What am I missing??
Let''s try this again - code sample :
MemoryStream strOutput = new MemoryStream();
System.Xml.XmlTextWriter writer = new XmlTextWriter(strOutput, null);
this.BackgroundColor = new BrushInfo(Color.Purple);
this.BackgroundColor.WriteXml(writer);
What am I missing??
ADAdministrator Syncfusion Team July 7, 2004 02:49 PM UTC
Hi Lori
You could use the XmlSerializer Class to do what you are seeking. Here is a code snippet which saves the information in a file called bginfo.xml:
string xmlFilename = "bginfo.xml";
XmlSerializer serializer = new XmlSerializer(typeof(Syncfusion.Drawing.BrushInfo));
Stream fs = new FileStream(xmlFilename, FileMode.Create);
System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(fs, System.Text.Encoding.Default);
serializer.Serialize(fs,this.gradientPanel1.BackgroundColor);
writer.Close();
Regards,
Arun