Jshafer55343 Posted April 25, 2007 Report Share Posted April 25, 2007 I am using Import and Export to pass formats between to gauges using the XML FileFormat, but they appears to be just minimum and maximum values in the XML and the colors seem to be the default for the Palette selected. How do I get the colors to transfer between gauges? Thanks, Jacob ************ I have attached the code and an example of the XML where the colors were selected but they do not appear. Example XML: <?xml version="1.0" encoding="UTF-8"?> <RadialGauge> <BACKCOLOR>Transparent</BACKCOLOR> <BORDER> <STYLE>RectangularBorder02</STYLE> </BORDER> <PALETTE>Default</PALETTE> <TITLES> <ITEM> <VISIBLE>False</VISIBLE> <LAYOUT> <TARGET>AnchorPoint</TARGET> </LAYOUT> <TEXT>%v</TEXT> </ITEM> </TITLES> <SCALES> <ITEM> <COLOR>#ffd7e1f3</COLOR> <INDEX>0</INDEX> <MIN>0</MIN> <MAX>100</MAX> <TICKMARKS> <VISIBLE>True</VISIBLE> <MAJOR> <LABEL> <VISIBLE>True</VISIBLE> </LABEL> </MAJOR> </TICKMARKS> <BAR> <BORDER> <VISIBLE>True</VISIBLE> </BORDER> </BAR> <INDICATORS> <ITEM type="ChartFX.WinForms.Gauge.Needle"> <INDEX>0</INDEX> </ITEM> </INDICATORS> <SECTIONS> <ITEM> <INDEX>0</INDEX> <MAX>25</MAX> </ITEM> <ITEM> <INDEX>1</INDEX> <MIN>25</MIN> <MAX>75</MAX> </ITEM> <ITEM> <INDEX>2</INDEX> <MIN>75</MIN> </ITEM> </SECTIONS> </ITEM> </SCALES> </RadialGauge> Code: Public Function PropertyToString(ByRef fromClass As ChartFX.WinForms.Gauge.BaseGauge) As String Dim memStream As New MemoryStream() Dim reader As StreamReader Dim propertyString As String fromClass.Export(ChartFX.WinForms.Gauge.FileFormat.XmlTemplate, memStream) memStream.Seek(0, SeekOrigin.Begin) reader = New StreamReader(memStream) propertyString = reader.ReadToEnd() reader.Close() memStream.Close() Return propertyString End Function Public Sub StringToClass(ByRef fromString As String, ByRef toClass As ChartFX.WinForms.Gauge.BaseGauge) Dim memStream As New MemoryStream() Dim writer As StreamWriter writer = New StreamWriter(memStream) writer.AutoFlush = True writer.Write(fromString) memStream.Seek(0, SeekOrigin.Begin) toClass.Import(ChartFX.WinForms.Gauge.FileFormat.XmlTemplate, memStream) writer.Close() memStream.Close() End Sub Quote Link to comment Share on other sites More sharing options...
Jshafer55343 Posted May 3, 2007 Author Report Share Posted May 3, 2007 I figured this out. I change a call to the section constructor from the one that took in min, max, and color and replaced it with the default one. After setting them manually it fixed the issue. -Jacob Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.