コード例 #1
0
ファイル: CoordinateLine.cs プロジェクト: Steiner-bot/Work
 public void Draw(CoordinatePlane cp, Graphics g)
 {
     if (drawPoints)
     {
         P1.Draw(cp, g); P2.Draw(cp, g);
     }
     g.DrawLine(new Pen(Color, LineWidth), cp.GetScaledX(P1.X), cp.GetScaledY(P1.Y), cp.GetScaledX(P2.X), cp.GetScaledY(P2.Y));
 }
コード例 #2
0
        public void Draw(CoordinatePlane cp, Graphics g)
        {
            Style.DrawLine(
                cp.GetScaledX(P1.X), cp.GetScaledY(P1.Y),
                cp.GetScaledX(P2.X), cp.GetScaledY(P2.Y), g);

            if (Style.DrawPoints)
            {
                P1.Draw(cp, g);
                P2.Draw(cp, g);
            }
        }
コード例 #3
0
        private void pbGame_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            //Draws the dashed white line in the middle
            Pen myPen = new Pen(Color.White, 2);

            myPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
            g.DrawLine(myPen, 330, 0, 330, 400);

            P1.Draw(g);
            P2.Draw(g);

            for (int i = 0; i < balls.Count; ++i)
            {
                Ball b = balls[i];
                b.Draw(g);
            }
        }