internal static Image CreatePuntalSymbol(Size symbolSize, ISymbolizer sym) { using (var map = new Map(symbolSize)) { var l = new PuntalVectorLayer("0", new GeometryProvider( map.Factory.CreatePoint(new Coordinate(symbolSize.Width / 2d, symbolSize.Height / 2d)))); var s = (IPointSymbolizer)sym.Clone(); s.Offset = new PointF(0, 0); if (s.Size.Width > symbolSize.Width) { s.Scale = (float)symbolSize.Width / s.Size.Width; } if (s.Size.Height * s.Scale > symbolSize.Height) { s.Scale = (float)symbolSize.Height / s.Size.Height; } s.Scale *= 0.8f; l.Symbolizer = s; map.Layers.Add(l); map.ZoomToBox(new Envelope(0, symbolSize.Width, 0, symbolSize.Height)); return(map.GetMap()); } }
internal static Image CreatePuntalSymbol(Size symbolSize, ISymbolizer sym) { using (var map = new Map(symbolSize)) { var l = new PuntalVectorLayer("0", new GeometryProvider( map.Factory.CreatePoint(new Coordinate(symbolSize.Width / 2d, symbolSize.Height / 2d)))); var s = (IPointSymbolizer)sym.Clone(); s.Offset = new PointF(0, 0); if (s.Size.Width > symbolSize.Width) s.Scale = (float)symbolSize.Width / s.Size.Width; if (s.Size.Height * s.Scale > symbolSize.Height) s.Scale = (float)symbolSize.Height / s.Size.Height; s.Scale *= 0.8f; l.Symbolizer = s; map.Layers.Add(l); map.ZoomToBox(new Envelope(0, symbolSize.Width, 0, symbolSize.Height)); return map.GetMap(); } }