private ValueRenderStruct ExportValueRender(MapObjects2.ValueMapRenderer render) { ValueRenderStruct oValueRender = new ValueRenderStruct(); this.DeconvertSymbol(render.DefaultSymbol, oValueRender.DefaultSymbol); oValueRender.Field = render.Field; oValueRender.RotationField = render.RotationField; oValueRender.ScaleField = render.ScalingField; oValueRender.SymbolType = (short)render.SymbolType; oValueRender.Tag = render.Tag; oValueRender.UseDefault = render.UseDefault; oValueRender.ValueCount = render.ValueCount; short iIndex = 0; MapObjects2.Symbol oMapSymbol = render.get_Symbol(iIndex); while (oMapSymbol != null) { SymbolStruct oSymbol = new SymbolStruct(); this.DeconvertSymbol(oMapSymbol, oSymbol); oValueRender.SymbolList.Add(oSymbol); iIndex++; oMapSymbol = render.get_Symbol(iIndex); } return(oValueRender); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mapEye_AfterLayerDraw(object sender, AxMapObjects2._DMapEvents_AfterLayerDrawEvent e) { if (e.index != 0) { return; } symE = new MapObjects2.SymbolClass(); symE.OutlineColor = (uint)MapObjects2.ColorConstants.moRed; symE.Outline = true; symE.SymbolType = MapObjects2.SymbolTypeConstants.moFillSymbol; symE.Style = (short)MapObjects2.FillStyleConstants.moTransparentFill; mapEye.DrawShape(mapMain.Extent, symE); MapObjects2.TextSymbol tsy = new MapObjects2.TextSymbolClass(); }
private void DeconvertSymbol(MapObjects2.Symbol fromSymbol, SymbolStruct toSymbol) { toSymbol.CenterOnAscent = fromSymbol.CenterOnAscent; toSymbol.CharacterIndex = fromSymbol.CharacterIndex; toSymbol.FillColor = System.Drawing.ColorTranslator.FromWin32((int)fromSymbol.Color); toSymbol.CustomSymbol = fromSymbol.Custom; toSymbol.FontName = fromSymbol.Font.Name; toSymbol.OutLine = fromSymbol.Outline; toSymbol.OutLineColor = System.Drawing.ColorTranslator.FromWin32((int)fromSymbol.OutlineColor); toSymbol.Rotation = fromSymbol.Rotation; toSymbol.Size = fromSymbol.Size; toSymbol.Style = fromSymbol.Style; toSymbol.SymbolType = (short)fromSymbol.SymbolType; }
public void ConvertSymbol(SymbolStruct fromSymbol, MapObjects2.Symbol toSymbol) { toSymbol.CenterOnAscent = fromSymbol.CenterOnAscent; toSymbol.CharacterIndex = fromSymbol.CharacterIndex; toSymbol.Color = Convert.ToUInt32(fromSymbol.FillColor.ToArgb()); toSymbol.Custom = fromSymbol.CustomSymbol; toSymbol.Font.Name = fromSymbol.FontName; toSymbol.Outline = fromSymbol.OutLine; toSymbol.OutlineColor = Convert.ToUInt32(fromSymbol.OutLineColor.ToArgb()); toSymbol.Rotation = fromSymbol.Rotation; toSymbol.Size = fromSymbol.Size; toSymbol.Style = fromSymbol.Style; toSymbol.SymbolType = (MapObjects2.SymbolTypeConstants)fromSymbol.SymbolType; }
public void ConvertSymbol(SymbolStruct fromSymbol, MapObjects2.Symbol toSymbol) { toSymbol.SymbolType = (MapObjects2.SymbolTypeConstants)fromSymbol.SymbolType; toSymbol.Color = (uint)Converter.ConvertSystemtoIntegerColor(fromSymbol.FillColor); // toSymbol.Custom = fromSymbol.CustomSymbol; toSymbol.Size = fromSymbol.Size; toSymbol.Style = fromSymbol.Style; if (fromSymbol.SymbolType == (short)MapObjects2.SymbolTypeConstants.moPointSymbol) { toSymbol.CenterOnAscent = fromSymbol.CenterOnAscent; toSymbol.CharacterIndex = fromSymbol.CharacterIndex; toSymbol.Font.Name = fromSymbol.FontName; toSymbol.Rotation = fromSymbol.Rotation; } else if (fromSymbol.SymbolType == (short)MapObjects2.SymbolTypeConstants.moFillSymbol) { toSymbol.Outline = fromSymbol.OutLine; toSymbol.OutlineColor = (uint)Converter.ConvertSystemtoIntegerColor(fromSymbol.OutLineColor); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listBox_SelectedIndexChanged(object sender, System.EventArgs e) { if (mapMain.TrackingLayer.EventCount > 0) { mapMain.TrackingLayer.RemoveEvent(0); } if (listBox.SelectedItems.Count > 0) { string slName = listBox.SelectedItem.ToString(); string s; MapObjects2.Point selectP = new MapObjects2.PointClass(); for (int i = 0; i < s_Info.Length; i++) { s = s_Info[i].s_Name + "热力站"; if (slName == s) { selectP.X = System.Convert.ToDouble(s_Info[i].s_East); selectP.Y = System.Convert.ToDouble(s_Info[i].s_West); mapMain.CenterAt(selectP.X, selectP.Y); MapObjects2.Symbol selectS = mapMain.TrackingLayer.get_Symbol(0); selectS.Color = System.Convert.ToUInt32(MapObjects2.ColorConstants.moBlue); selectS.Size = 10; mapMain.TrackingLayer.AddEvent(selectP, 0); } } } if (this.timer1.Enabled == false) { this.timer1.Enabled = true; } else { this.timer1.Enabled = false; this.timer1.Enabled = true; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void axMap2_AfterLayerDraw(object sender, AxMapObjects2._DMapEvents_AfterLayerDrawEvent e) { if(e.index!=0) return; symE=new MapObjects2.SymbolClass(); symE.OutlineColor=(uint)MapObjects2.ColorConstants.moRed; symE.Outline=true; symE.SymbolType=MapObjects2.SymbolTypeConstants.moFillSymbol; symE.Style=(short)MapObjects2.FillStyleConstants.moTransparentFill; axMap2.DrawShape(axMap1.Extent,symE); MapObjects2.TextSymbol tsy=new MapObjects2.TextSymbolClass(); }