示例#1
0
        void DrawE(Painter p)
        {
            p.Clear(PixelFarm.Drawing.Color.White);
            p.StrokeColor = PixelFarm.Drawing.Color.Red;

            using (Tools.BorrowVxs(out var v1, out var v2))
                using (Tools.BorrowPathWriter(v1, out var w))
                {
                    w.Clear();
                    w.MoveTo(150, 10);
                    w.LineTo(110, 10);
                    w.LineTo(150, 20);


                    StrokeGen2 gen2 = new StrokeGen2(); //under construction!
                    gen2.LineCapStyle    = LineCap.Butt;
                    gen2.LineJoinStyle   = LineJoin.Miter;
                    gen2.HalfStrokeWidth = 7;//
                    gen2.Generate(v1, v2);
                    //-----------------------------------------------------
                    p.Fill(v2, PixelFarm.Drawing.Color.Red);
                    p.StrokeWidth = 1f;
                    p.Draw(v1, PixelFarm.Drawing.Color.Black);
                }
        }
示例#2
0
        void DrawE(PixelFarm.Drawing.Painter painter)
        {
            PathWriter ps = new PathWriter();

            painter.Clear(PixelFarm.Drawing.Color.White);
            painter.StrokeColor = PixelFarm.Drawing.Color.Red;


            //p.Line(10, 10, 50, 10);
            //p.Line(50, 10, 50, 50);
            //p.Line(50, 50, 10, 50);
            //p.Line(50, 10, 10, 10);

            ps.Clear();
            //ps.MoveTo(10, 10);
            //ps.LineTo(50, 10);
            //ps.LineTo(50, 50);

            //ps.MoveTo(10, 10);
            //ps.LineTo(50, 10);
            //ps.LineTo(10, 20);

            ps.MoveTo(150, 10);
            ps.LineTo(110, 10);
            ps.LineTo(150, 20);

            //ps.MoveTo(50, 50);
            //ps.LineTo(40, 50);
            //ps.LineTo(80, 70);


            //ps.CloseFigure();

            //p.Fill(ps.Vxs, PixelFarm.Drawing.Color.Black);
            VertexStore output = new VertexStore();
            StrokeGen2  gen2   = new StrokeGen2();

            gen2.LineCapStyle    = LineCap.Butt;
            gen2.LineJoinStyle   = LineJoin.Miter;
            gen2.HalfStrokeWidth = 7;//
            gen2.Generate(ps.Vxs, output);
            //-----------------------------------------------------

            painter.Fill(output, PixelFarm.Drawing.Color.Red);
            painter.StrokeWidth = 1f;
            painter.Draw(ps.Vxs, PixelFarm.Drawing.Color.Black);
        }
示例#3
0
        void DrawE(Painter painter)
        {
            painter.Clear(PixelFarm.Drawing.Color.White);
            painter.StrokeColor = PixelFarm.Drawing.Color.Red;


            //p.Line(10, 10, 50, 10);
            //p.Line(50, 10, 50, 50);
            //p.Line(50, 50, 10, 50);
            //p.Line(50, 10, 10, 10);

            using (VxsTemp.Borrow(out var v1, out var v2))
                using (VectorToolBox.Borrow(v1, out PathWriter ps))
                {
                    ps.Clear();
                    //ps.MoveTo(10, 10);
                    //ps.LineTo(50, 10);
                    //ps.LineTo(50, 50);

                    //ps.MoveTo(10, 10);
                    //ps.LineTo(50, 10);
                    //ps.LineTo(10, 20);

                    ps.MoveTo(150, 10);
                    ps.LineTo(110, 10);
                    ps.LineTo(150, 20);

                    //ps.MoveTo(50, 50);
                    //ps.LineTo(40, 50);
                    //ps.LineTo(80, 70);


                    //ps.CloseFigure();

                    //p.Fill(ps.Vxs, PixelFarm.Drawing.Color.Black);

                    StrokeGen2 gen2 = new StrokeGen2(); //under construction!
                    gen2.LineCapStyle    = LineCap.Butt;
                    gen2.LineJoinStyle   = LineJoin.Miter;
                    gen2.HalfStrokeWidth = 7;//
                    gen2.Generate(v1, v2);
                    //-----------------------------------------------------
                    painter.Fill(v2, PixelFarm.Drawing.Color.Red);
                    painter.StrokeWidth = 1f;
                    painter.Draw(v1, PixelFarm.Drawing.Color.Black);
                }
        }