public void TestCharacterPointSymbolizer() { var fdt = CreatingData.CreatePointFeatureDataTableFromArrays( CreatingData.GetRandomOrdinates(50, -180, 180), CreatingData.GetRandomOrdinates(50, -90, 90), null); var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt); var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider); var cps = new SharpMap.Styles.Symbolizer.CharacterPointSymbolizer { Halo = 1, HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Wheat), //Font = new System.Drawing.Font("Arial", 12), CharacterIndex = 0xcc, }; layer.Style.PointSymbolizer = cps; var map = new SharpMap.Map(new System.Drawing.Size(720, 360)); map.Layers.Add(layer); map.ZoomToExtents(); map.GetMap().Save("CharacterPointSymbolizer1.bmp"); cps.Rotation = -30; cps.Offset = new System.Drawing.PointF(4, 4); map.GetMap().Save("CharacterPointSymbolizer2.bmp"); cps.Font = new System.Drawing.Font("Arial", 12); cps.Text = "ABC"; cps.Offset = System.Drawing.PointF.Empty; cps.Rotation = -90; map.GetMap().Save("CharacterPointSymbolizer3.bmp"); }
public void TestListPointSymbolizer() { var fdt = CreatingData.CreatePointFeatureDataTableFromArrays( CreatingData.GetRandomOrdinates(50, -180, 180), CreatingData.GetRandomOrdinates(50, -90, 90), null); var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt); var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider); var pps = SharpMap.Styles.Symbolizer.PathPointSymbolizer.CreateSquare(new System.Drawing.Pen(System.Drawing.Color.Red, 2), new System.Drawing.SolidBrush( System.Drawing.Color.DodgerBlue), 20); var cps = new SharpMap.Styles.Symbolizer.CharacterPointSymbolizer { Halo = 1, HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke), Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black), Font = new System.Drawing.Font("Arial", 12), CharacterIndex = 65 }; var lps = new SharpMap.Styles.Symbolizer.ListPointSymbolizer { pps, cps }; layer.Style.PointSymbolizer = lps; var map = new SharpMap.Map(new System.Drawing.Size(720, 360)); map.Layers.Add(layer); map.ZoomToExtents(); map.GetMap().Save("ListPointSymbolizer1.bmp"); }
public void TestCharacterPointSymbolizer() { var fdt = CreatingData.CreatePointFeatureDataTableFromArrays( CreatingData.GetRandomOrdinates(50, -180, 180), CreatingData.GetRandomOrdinates(50, -90, 90), null); var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt); var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider); var cps = new SharpMap.Styles.Symbolizer.CharacterPointSymbolizer { Halo = 1, HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Wheat), //Font = new System.Drawing.Font("Arial", 12), CharacterIndex = 0xcc, }; layer.Style.PointSymbolizer = cps; var map = new SharpMap.Map(new System.Drawing.Size(720, 360)); map.Layers.Add(layer); map.ZoomToExtents(); map.GetMap().Save("CharacterPointSymbolizer1.bmp"); cps.Rotation = -30; cps.Offset = new System.Drawing.PointF(4, 4); map.GetMap().Save("CharacterPointSymbolizer2.bmp"); cps.Font = new System.Drawing.Font("Arial", 12); cps.Text = "ABC"; cps.Offset = System.Drawing.PointF.Empty; cps.Rotation = -90; map.GetMap().Save("CharacterPointSymbolizer3.bmp"); }
public void TestRasterPointSymbolizer() { var fdt = CreatingData.CreatePointFeatureDataTableFromArrays( CreatingData.GetRandomOrdinates(50, -180, 180), CreatingData.GetRandomOrdinates(50, -90, 90), null); var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt); var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider); var rps = new SharpMap.Styles.Symbolizer.RasterPointSymbolizer { Symbol = new System.Drawing.Bitmap("women.png") }; layer.Style.PointSymbolizer = rps; var map = new SharpMap.Map(new System.Drawing.Size(720, 360)); map.Layers.Add(layer); map.ZoomToExtents(); map.GetMap().Save("RasterPointSymbolizer1.bmp"); rps.Rotation = 45; map.GetMap().Save("RasterPointSymbolizer2.bmp"); rps.Rotation = 0; var cps = new SharpMap.Styles.Symbolizer.CharacterPointSymbolizer { Halo = 1, HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke), Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black), Font = new System.Drawing.Font("Arial", 12), Text = "Anne", Offset = new System.Drawing.PointF(0, rps.Size.Height * 0.5f) }; var lps = new SharpMap.Styles.Symbolizer.ListPointSymbolizer { rps, cps }; layer.Style.PointSymbolizer = lps; map.Layers.Add(layer); map.ZoomToExtents(); map.GetMap().Save("RasterPointSymbolizer3.bmp"); }
public void TestListPointSymbolizer() { var fdt = CreatingData.CreatePointFeatureDataTableFromArrays( CreatingData.GetRandomOrdinates(50, -180, 180), CreatingData.GetRandomOrdinates(50, -90, 90), null); var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt); var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider); var pps = SharpMap.Styles.Symbolizer.PathPointSymbolizer.CreateSquare(new System.Drawing.Pen(System.Drawing.Color.Red, 2), new System.Drawing.SolidBrush( System.Drawing.Color.DodgerBlue), 20); var cps = new SharpMap.Styles.Symbolizer.CharacterPointSymbolizer { Halo = 1, HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke), Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black), Font = new System.Drawing.Font("Arial", 12), CharacterIndex = 65 }; var lps = new SharpMap.Styles.Symbolizer.ListPointSymbolizer { pps, cps }; layer.Style.PointSymbolizer = lps; var map = new SharpMap.Map(new System.Drawing.Size(720, 360)); map.Layers.Add(layer); map.ZoomToExtents(); map.GetMap().Save("ListPointSymbolizer1.bmp"); }
public void TestRasterPointSymbolizer() { var fdt = CreatingData.CreatePointFeatureDataTableFromArrays( CreatingData.GetRandomOrdinates(50, -180, 180), CreatingData.GetRandomOrdinates(50, -90, 90), null); var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt); var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider); var rps = new SharpMap.Styles.Symbolizer.RasterPointSymbolizer {Symbol = new System.Drawing.Bitmap("women.png")}; layer.Style.PointSymbolizer = rps; var map = new SharpMap.Map(new System.Drawing.Size(720, 360)); map.Layers.Add(layer); map.ZoomToExtents(); map.GetMap().Save("RasterPointSymbolizer1.bmp"); rps.Rotation = 45; map.GetMap().Save("RasterPointSymbolizer2.bmp"); rps.Rotation = 0; var cps = new SharpMap.Styles.Symbolizer.CharacterPointSymbolizer { Halo = 1, HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke), Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black), Font = new System.Drawing.Font("Arial", 12), Text = "Anne", Offset = new System.Drawing.PointF(0, rps.Size.Height*0.5f) }; var lps = new SharpMap.Styles.Symbolizer.ListPointSymbolizer { rps, cps }; layer.Style.PointSymbolizer = lps; map.Layers.Add(layer); map.ZoomToExtents(); map.GetMap().Save("RasterPointSymbolizer3.bmp"); }