public override void Draw(IDraw draw) { draw.DrawRectangleLine(1, this.Color, this.Rectangle.Left, this.Rectangle.Top, this.Rectangle.Width, this.Rectangle.Height, DrawLineStyle.Solid, null); // 绘制矩形 draw.DrawLine( 1, this.Color, this.Rectangle.Left, this.Rectangle.Top+this.Rectangle.Height/2, 1, 1, DrawLineStyle.Solid, null); // 绘制横线 if (!this.Expand) { draw.DrawLine(1, this.Color, this.Rectangle.Left + this.Rectangle.Width / 2, this.Rectangle.Top, 1, 1, DrawLineStyle.Solid, null); // 绘制竖线 } }
public void DrawLine(System.Drawing.Pen pen, int x1, int y1, int x2, int y2) { if (InRange(x1, y1, x2, y2)) { drawer.DrawLine(pen, x1, y1, x2, y2); } }
public static void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2) { _Draw.DrawLine(a, r, g, b, w, x1, y1, x2, y2); }
private void button2_Click(object sender, EventArgs e) { //sdfmdskfmdslfmdskmfsdkfs graphForDraw = ReadInput(); button2.Visible = false; int Xmax, Ymax; pictureBox1.Dock = DockStyle.Left; //Xmax = ClientSize.Width; //Ymax = ClientSize.Height; Size size = pictureBox1.Size; Xmax = size.Width; Ymax = size.Height; //pictureBox1.Size = new Size(Xmax,Ymax); //graphForDraw.GenerateVertexsPosition(Xmax - 10, Ymax - 10); var viz = new Vizualization(Xmax, Ymax); areaDraw = new DrawWithSize(viz,30); areaDraw.Background(); //areaDraw.DrawGraph(graphForDraw); Point p1 = new Point(0,0); Point p2 = new Point(Xmax,Ymax); areaDraw.DrawLine(p1, p2); pictureBox1.Image = areaDraw.getPicture(); pictureBox1.Update(); button1.Visible = true; }