private void TestSlopeLine(Graphics g) { /* //X軸の方が長い場合 //線分の描画(斜め、傾き正) g.DrawLine(0, 0, 100, 50); g.DrawLine(100, 50, 0, 100); //線分の描画(斜め、傾き負) g.DrawLine(100, 0, 0, 50); g.DrawLine(0, 50, 100, 100); */ /* //Y軸の方が長い場合 g.DrawLine(0, 0, 50, 100); g.DrawLine(50, 0, 0, 100); */ g.DrawCircle(50, 50, 50); //g.DrwaEllipse(0, 0, 100, 100); //g.DrawCircle(); //g.DrawRect(); //g.DrawRoundRect(); }
private void TestHorizontalLine(Graphics g) { //線分の描画(X方向) g.DrawLine(-50, 10, 100, 10); //線分の描画(Y軸に平行) g.DrawLine(10, -50, 10, 100); }
private void TestPoint(Graphics g) { //点の描画 g.DrawPoint(Width / 2, Height / 2); }
public override void Draw(Graphics g) { //TestPoint(g); //TestHorizontalLine(g); TestSlopeLine(g); }
private void CreateGraphics() { graphics = new Graphics(); //★ここでコンテキストの初期化設定をしたい。 graphics.Color = System.Drawing.Color.Black; }
public virtual void Draw(Graphics g) { }