public IGraphic newText(string text, IMapPoint p, Color color, string fontName, double fontSize) { IS3TextSymbol textSymbol = new IS3TextSymbol(); textSymbol.Text = text; textSymbol.Color = color; IS3SymbolFont font = new IS3SymbolFont(fontName, fontSize); textSymbol.Font = font; IS3Graphic g = new IS3Graphic(); g.Symbol = textSymbol; g.Geometry = p; return(g); }
public ISymbol newSymbol(SymbolDef symbolDef) { if (symbolDef == null) { return(null); } Type symbolType = symbolDef.GetType(); if (symbolType == typeof(SimpleLineSymbolDef)) { SimpleLineSymbolDef sDef = (SimpleLineSymbolDef)symbolDef; IS3SimpleLineSymbol symbol = new IS3SimpleLineSymbol(); symbol.Color = sDef.Color; symbol.Style = sDef.Style; symbol.Width = sDef.Width; return(symbol); } else if (symbolType == typeof(SimpleFillSymbolDef)) { SimpleFillSymbolDef sDef = (SimpleFillSymbolDef)symbolDef; IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol(); symbol.Color = sDef.Color; symbol.Style = sDef.Style; symbol.Outline = (ISimpleLineSymbol)newSymbol(sDef.OutlineDef); return(symbol); } else if (symbolType == typeof(SimpleMarkerSymbolDef)) { SimpleMarkerSymbolDef sDef = (SimpleMarkerSymbolDef)symbolDef; IS3SimpleMarkerSymbol symbol = new IS3SimpleMarkerSymbol(); symbol.Angle = sDef.Angle; symbol.AngleAlignment = sDef.AngleAlignment; symbol.Color = sDef.Color; symbol.Outline = (ISimpleLineSymbol)newSymbol(sDef.OutlineDef); symbol.Size = sDef.Size; symbol.Style = sDef.Style; symbol.XOffset = sDef.XOffset; symbol.YOffset = sDef.YOffset; return(symbol); } else if (symbolType == typeof(TextSymbolDef)) { TextSymbolDef sDef = (TextSymbolDef)symbolDef; IS3TextSymbol symbol = new IS3TextSymbol(); symbol.Angle = sDef.Angle; symbol.AngleAlignment = sDef.AngleAlignment; symbol.BackgroundColor = sDef.BackgroundColor; symbol.BorderLineColor = sDef.BorderLineColor; symbol.BorderLineSize = sDef.BorderLineSize; symbol.Color = sDef.Color; symbol.Text = sDef.Text; symbol.HorizontalTextAlignment = sDef.HorizontalTextAlignment; symbol.VerticalTextAlignment = sDef.VerticalTextAlignment; symbol.Font = newSymbolFont(sDef.FontDef); symbol.XOffset = sDef.XOffset; symbol.YOffset = sDef.YOffset; return(symbol); } return(null); }