Exemplo n.º 1
0
 private void pictureBox1_Paint(object sender, PaintEventArgs e)
 {
     var blackPen = new Pen(Color.Black, 2);
     foreach (C2DPoint p in points)
     {
         e.Graphics.FillRectangle(Brushes.Red,(float) p.x,(float) p.y, 5f, 5f);
     }
     // var poly = AlgorithmsUtil.RandomConvexPolygon(7, 7, 500);
     var geoDraw = new CGeoDraw();
     foreach (C2DLine edge in result.edgeList)
     {
         geoDraw.Draw(edge, e.Graphics, blackPen);
     }
 }
Exemplo n.º 2
0
        private void pictureBox2_Paint(object sender, PaintEventArgs e)
        {
            var blackPen = new Pen(Color.Black, 2);
            var geoDraw = new CGeoDraw();
            //var poly = AlgorithmsUtil.RndCvxPolygonNewConverted(100, 500);
            //geoDraw.Draw(poly, e.Graphics, blackPen);

            foreach (var t in Vertices)
            {
                foreach (var edge in t.Edges)
                {
                    geoDraw.Draw(edge.CreateLine(), e.Graphics, blackPen);
                }
            }
        }