コード例 #1
0
        public void RenderPolygon()
        {
            // arrange
            var          map      = PolygonSample.CreateMap();
            const string fileName = "polygon.png";

            // act
            var bitmap = new MapRenderer().RenderToBitmapStream(map.Viewport, map.Layers, map.BackColor);

            // aside
            File.WriteToGeneratedFolder(fileName, bitmap);

            // assert
            Assert.IsTrue(CompareBitmaps(File.ReadFromOriginalFolder(fileName), bitmap));
        }
コード例 #2
0
        public void RenderPolygon()
        {
            // arrange
            using var map = PolygonSample.CreateMap();
            var          viewport = map.Extent !.Multiply(1.1).ToViewport(600);
            const string fileName = "polygon.png";

            // act
            using var bitmap = new MapRenderer().RenderToBitmapStream(viewport, map.Layers, map.BackColor);

            // aside
            File.WriteToGeneratedTestImagesFolder(fileName, bitmap);

            // assert
            Assert.IsTrue(CompareBitmaps(File.ReadFromOriginalFolder(fileName), bitmap));
        }
コード例 #3
0
ファイル: MapRendererTests.cs プロジェクト: zoomvr/Mapsui
        public void RenderPolygon()
        {
            // arrange
            var map      = PolygonSample.CreateMap();
            var viewport = new Viewport
            {
                Center     = new Point(0, 0),
                Width      = 600,
                Height     = 400,
                Resolution = 63000
            };
            const string fileName = "polygon.png";

            // act
            var bitmap = new MapRenderer().RenderToBitmapStream(viewport, map.Layers, map.BackColor);

            // aside
            File.WriteToGeneratedFolder(fileName, bitmap);

            // assert
            Assert.IsTrue(CompareBitmaps(File.ReadFromOriginalFolder(fileName), bitmap));
        }