//添加个按钮,一个Timer空间看效果(还没学会拐弯)
private void button1_Click(object sender, EventArgs e)
{
Graphics graphics = this.CreateGraphics();
graphics.Clear(Color.White);
Pen pen = new Pen(Color.Blue, 2);
graphics.TranslateTransform(0, 30);
pen.DashStyle = (DashStyle)0;
graphics.DrawLine(pen, 10, 0, 1260, 0);
graphics.DrawLine(pen, 10, 300, 1260, 300);
graphics.DrawRectangle(pen, 600, 300, 150, 260);
graphics.DrawRectangle(pen, 450, 300, 150, 260);
//绘制椭圆
//Pen pen1 = new Pen(Color.Red, 2);
//graphics.TranslateTransform(0, 30);
//pen1.DashStyle = DashStyle.DashDotDot;
//graphics.DrawEllipse(pen1, 0, 100, 100, 30);
//Graphics graph_car = this.CreateGraphics()
学习GDI+画出汽车行进路线c#(winform)
最新推荐文章于 2024-06-24 11:23:30 发布