C#绘制椭圆的方法
程序员文章站
2024-03-30 21:25:03
本文实例讲述了c#绘制椭圆的方法。分享给大家供大家参考。具体实现方法如下:
using system;
using system.collections.gen...
本文实例讲述了c#绘制椭圆的方法。分享给大家供大家参考。具体实现方法如下:
using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.text; using system.windows.forms; namespace windowsapplication2 { public partial class form4 : form { public form4() { initializecomponent(); } bool drawelipse = false; private void button1_click(object sender, eventargs e) { this.drawelipse = !this.drawelipse; using (graphics g = this.creategraphics()) { if (this.drawelipse) { g.fillellipse(brushes.darkblue, this.clientrectangle); } else { g.fillellipse(systembrushes.control, this.clientrectangle); } } } private void form4_load(object sender, eventargs e) { } } }
希望本文所述对大家的c#程序设计有所帮助。