예제 #1
0
        public void CorrectlySetsBrushAndShape()
        {
            img.Fill(brush, shape);

            Assert.NotEmpty(img.ProcessorApplications);
            FillRegionProcessor <Color> processor = Assert.IsType <FillRegionProcessor <Color> >(img.ProcessorApplications[0].processor);

            Assert.Equal(GraphicsOptions.Default, processor.Options);

            ShapeRegion region = Assert.IsType <ShapeRegion>(processor.Region);

            Assert.Equal(shape, region.Shape);

            Assert.Equal(brush, processor.Brush);
        }
예제 #2
0
        public void CorrectlySetsBrushAndPath()
        {
            img.Fill(brush, path);

            Assert.NotEmpty(img.ProcessorApplications);
            FillRegionProcessor <Color> processor = Assert.IsType <FillRegionProcessor <Color> >(img.ProcessorApplications[0].processor);

            Assert.Equal(GraphicsOptions.Default, processor.Options);

            ShapeRegion region = Assert.IsType <ShapeRegion>(processor.Region);

            // path is converted to a polygon before filling
            Polygon           polygon  = Assert.IsType <Polygon>(region.Shape);
            LinearLineSegment segments = Assert.IsType <LinearLineSegment>(polygon.LineSegments[0]);

            Assert.Equal(brush, processor.Brush);
        }
        public void CorrectlySetsBrushAndRectangle()
        {
            img.Fill(brush, rectangle);

            Assert.NotEmpty(img.ProcessorApplications);
            FillRegionProcessor <Color> processor = Assert.IsType <FillRegionProcessor <Color> >(img.ProcessorApplications[0].processor);

            Assert.Equal(GraphicsOptions.Default, processor.Options);

            ShapeRegion region = Assert.IsType <ShapeRegion>(processor.Region);

            SixLabors.Shapes.Rectangle rect = Assert.IsType <SixLabors.Shapes.Rectangle>(region.Shape);
            Assert.Equal(rect.Location.X, rectangle.X);
            Assert.Equal(rect.Location.Y, rectangle.Y);
            Assert.Equal(rect.Size.Width, rectangle.Width);
            Assert.Equal(rect.Size.Height, rectangle.Height);

            Assert.Equal(brush, processor.Brush);
        }
예제 #4
0
        public void CorrectlySetsBrushAndPath()
        {
            img.Fill(brush, pathCollection);

            Assert.Equal(2, img.ProcessorApplications.Count);
            for (var i = 0; i < 2; i++)
            {
                FillRegionProcessor <Rgba32> processor = Assert.IsType <FillRegionProcessor <Rgba32> >(img.ProcessorApplications[i].processor);

                Assert.Equal(GraphicsOptions.Default, processor.Options);

                ShapeRegion region = Assert.IsType <ShapeRegion>(processor.Region);

                // path is converted to a polygon before filling
                Polygon           polygon  = Assert.IsType <Polygon>(region.Shape);
                LinearLineSegment segments = Assert.IsType <LinearLineSegment>(polygon.LineSegments[0]);

                Assert.Equal(brush, processor.Brush);
            }
        }