public ColorPicker(MapWinGIS.GridColorBreak colorBreak) { InitializeComponent(); btnStartColor.BackColor = ColorScheme.UIntToColor(colorBreak.LowColor); btnEndColor.BackColor = ColorScheme.UIntToColor(colorBreak.HighColor); m_SFBreak = null; m_GrdBreak = colorBreak; }
public ColorPicker(System.Drawing.Color startc, System.Drawing.Color endc) { InitializeComponent(); m_GrdBreak = null; m_SFBreak = null; btnStartColor.BackColor = startc; btnEndColor.BackColor = endc; UpdatePreview(); }
public static bool ImportScheme(MapWinGIS.GridColorScheme sch, XmlElement e) { int i; MapWinGIS.GridColorBreak brk; string t; double azimuth; double elevation; XmlNode n; if (e == null) { return(false); } sch.Key = e.Attributes["Key"].InnerText; t = e.Attributes["AmbientIntensity"].InnerText; sch.AmbientIntensity = MapWinGIS.Utility.MiscUtils.ParseDouble(t, 0.7); t = e.Attributes["LightSourceAzimuth"].InnerText; azimuth = MapWinGIS.Utility.MiscUtils.ParseDouble(t, 90.0); t = e.Attributes["LightSourceElevation"].InnerText; elevation = MapWinGIS.Utility.MiscUtils.ParseDouble(t, 45.0); sch.SetLightSource(azimuth, elevation); t = e.Attributes["LightSourceIntensity"].InnerText; sch.LightSourceIntensity = MapWinGIS.Utility.MiscUtils.ParseDouble(t, 0.7); for (i = 0; i <= e.ChildNodes.Count - 1; i++) { n = e.ChildNodes[i]; brk = new MapWinGIS.GridColorBreak(); brk.Caption = n.Attributes["Caption"].InnerText; brk.LowColor = ColorScheme.ColorToUInt(Color.FromArgb(System.Convert.ToInt32(n.Attributes["LowColor"].InnerText))); brk.HighColor = ColorScheme.ColorToUInt(Color.FromArgb(System.Convert.ToInt32(n.Attributes["HighColor"].InnerText))); brk.LowValue = MapWinGIS.Utility.MiscUtils.ParseDouble(n.Attributes["LowValue"].InnerText, 0.0); brk.HighValue = MapWinGIS.Utility.MiscUtils.ParseDouble(n.Attributes["HighValue"].InnerText, 0.0); brk.ColoringType = (MapWinGIS.ColoringType)Enum.Parse(typeof(MapWinGIS.ColoringType), n.Attributes["ColoringType"].InnerText); brk.GradientModel = (MapWinGIS.GradientModel)Enum.Parse(typeof(MapWinGIS.GradientModel), n.Attributes["GradientModel"].InnerText); sch.InsertBreak(brk); } return(true); }