/// <summary>${IS6_ServerStyle_constructor_None_D}</summary> public ServerStyle() { BrushOpaqueRate = 100; BrushBackColor = new ServerColor(255, 255, 255); BrushColor = new ServerColor(255, 255, 0); PenColor = new ServerColor(197, 198, 201); PenWidth = 1; }
/// <summary>${IS6_ServerTextStyle_constructor_None_D}</summary> public ServerTextStyle() { BgColor = new ServerColor() { Red = 255, Green = 0, Blue = 0 }; Color = new ServerColor() { Red = 0, Green = 255, Blue = 0 }; FontHeight = 39; FontWidth = 0; FontName = "宋体"; Transparent = true; }
//ServerColor返回的int: // byte[] brg = new byte[4] { c.B, c.G, c.R, c.A }; // int pixel = BitConverter.ToInt32(brg, 0); internal static int ToJson(ServerColor param) { if (param == null) { return 0; } //byte[] brg = new byte[4] { (byte)param.Blue, (byte)param.Green, (byte)param.Red, (byte)0 }; //int pixel = BitConverter.ToInt32(brg, 0); int pixel = (param.Blue << 16) | (param.Green << 8) | param.Red; return pixel; }
/// <summary>${IS6_ServerColor_method_FromJson_D}</summary> /// <param name="jsonObject">${IS6_ServerColor_method_FromJson_param_jsonObject}</param> /// <returns>${IS6_ServerColor_method_FromJson_return}</returns> public static ServerColor FromJson(int jsonObject) { int pixel = jsonObject; byte mask = byte.MaxValue; int a = pixel >> 24; int b = (pixel >> 16) & (mask); int g = (pixel >> 8) & (mask); int r = pixel & mask; ServerColor result = new ServerColor { Blue = b, Red = r, Green = g }; return result; }
//栅格范围分段专题图 private void commit_Click(object sender, RoutedEventArgs e) { List<ServerColor> colors = new List<ServerColor>(); ServerColor color1 = new ServerColor(255, 0, 0); ServerColor color2 = new ServerColor(0, 255, 0); ServerColor color3 = new ServerColor(0, 0, 255); ServerColor color4 = new ServerColor(255, 255, 0); ServerColor color5 = new ServerColor(255, 0, 255); ServerColor color6 = new ServerColor(0, 255, 255); colors.Add(color1); colors.Add(color2); colors.Add(color3); colors.Add(color4); colors.Add(color5); colors.Add(color6); ThemeGridRange gridRange = new ThemeGridRange() { BreakValues = new List<double>() { 1200, 1250, 1300, 1350, 1400 }, Caption = "栅格范围分段专题图", Displays = colors }; ThemeParameters parameters = new ThemeParameters() { MapName = "DEM", Theme = gridRange, LayerNames = layerNames, ThemeLayer = "DEM@dem" }; //与服务器交互 ThemeService service = new ThemeService("http://localhost/IS/AjaxDemo"); service.ProcessAsync(parameters); service.Failed += new EventHandler<ServiceFailedEventArgs>(service_Failed); service.ProcessCompleted += new EventHandler<ThemeEventArgs>(service_ProcessCompleted); }