资 源 简 介
应用背景这是一用c#编写的程序,本质是画图,用一个timer控件实现速度的可控性,速度快慢是可以调节的,即在一定的时间内画图,实现高级人机交互,除此之外,图形是随机的,并且还能比较图形的大小,并且放大图形,汉字描述图形,确定图形名称, public string Name { get; set; }
public virtual void Draw(Graphics g){}
public virtual double Square() { return 0.0; }
public static bool operator>=(MyShapes s1,MyShapes s2){return s1.Square()>=s2.Square();}
public static bool operator <=(MyShapes s1, MyShapes s2) { return s1.Square()<=s2.Square(); }关键技术MyShapes s1, s2;
s1 = new MyCircle(200, 100, 80);
s2 = new MyRect(200, 100, 20, 300);
Graphics g = this.CreateGraphics();
s1.Draw(g);