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.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); } }
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); oValueRender.ValueList.Add(render.get_Value(iIndex)); iIndex++; try { oMapSymbol = render.get_Symbol(iIndex); } catch { break; } } return(oValueRender); }