- 爱易网页
-
C#教程
- 小弟我写的一个产生灵异现象的代码,看小弟我中华,有哪位高手能解释这个灵异现象
日期:2014-05-19 浏览次数:21039 次
我写的一个产生灵异现象的代码,看我中华,有谁能解释这个灵异现象!
请大家将以下代码拷贝到一个窗体里,然后放一个Button1,将Button1的点击事件连接到button1_click,然后运行,点button1,看看到底发生了什么样的灵异现象!
Graphics picture;
int y0 = 0;
private void button1_Click(object sender, EventArgs e)
{
picture = this.CreateGraphics();
y0 = 0;
Draw(Brushes.Red, p(0, 5), p(8, 2), p(8, 5));
Draw(Brushes.Blue, p(8, 2), p(13, 0), p(13, 2));
Draw(Brushes.Yellow, p(8, 2), p(13, 2), p(13, 3), p(10, 3), p(10, 4), p(8, 4));
Draw(Brushes.Green, p(8, 4), p(10, 4), p(10, 3), p(13, 3), p(13, 5), p(8, 5));
y0 = 160;
Draw(Brushes.Blue, p(0, 5), p(5, 3), p(5, 5));
Draw(Brushes.Red, p(5, 3), p(13, 0), p(13, 3));
Draw(Brushes.Yellow, p(5, 3), p(10, 3), p(10, 4), p(7, 4), p(7, 5), p(5, 5));
Draw(Brushes.Green, p(8, 4), p(10, 4), p(10, 3), p(13, 3), p(13, 5), p(8, 5));
}
void Draw(Brush brush, params Point[] p)
{
picture.FillPolygon(brush, p);
}
Point p(int x, int y)
{
return new Point(x * 30 + 5, y * 30 + 5 + y0);
}
------解决方案--------------------
LZ很无聊,这个很早就看过了!大三角的斜边并不是一条直线。所以才会这样!