C#繪制橢圓的方法
更新時間:2015年06月11日 12:36:33 作者:zhuzhao
這篇文章主要介紹了C#繪制橢圓的方法,涉及C#圖形繪制的相關(guān)技巧,需要的朋友可以參考下
本文實例講述了C#繪制橢圓的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:
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#程序設(shè)計有所幫助。
相關(guān)文章
解析c#操作excel后關(guān)閉excel.exe的方法
C#和Asp.net下excel進程一被打開,有時就無法關(guān)閉,尤其是website.對關(guān)閉該進程有過GC、release等方法,但這些方法并不是在所有情況下均適用2013-07-07C#中IEnumerable、ICollection、IList、List之間的區(qū)別
IEnumerable、ICollection、IList、List之間的區(qū)別,本文分別分析了它的實現(xiàn)源碼,從而總結(jié)出了它們之間的關(guān)系和不同之處。對C# IEnumerable、ICollection、IList、List相關(guān)知識,感興趣的朋友一起看看吧2021-07-07C#+無unsafe的非托管大數(shù)組示例詳解(large unmanaged array in c# without ‘u
這篇文章主要給大家介紹了關(guān)于C#+無unsafe的非托管大數(shù)組(large unmanaged array in c# without 'unsafe' keyword)的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-01-01c# 線程定時器 System.Threading.Timer的使用
本文主要介紹了c# 線程定時器 System.Threading.Timer的使用,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-02-02