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#?winform中ComboBox數(shù)據(jù)綁定的兩種方法及效率詳解
這篇文章主要給大家介紹了關(guān)于C#?winform中ComboBox數(shù)據(jù)綁定的兩種方法及效率,Winform?ComboBox數(shù)據(jù)綁定是指將數(shù)據(jù)源中的數(shù)據(jù)與ComboBox控件進(jìn)行關(guān)聯(lián),需要的朋友可以參考下2023-08-08
詳解C# 泛型中的數(shù)據(jù)類型判定與轉(zhuǎn)換
這篇文章主要介紹了C# 泛型中的數(shù)據(jù)類型判定與轉(zhuǎn)換,文中講解非常細(xì)致,代碼幫助大家更好的理解和學(xué)習(xí),感興趣的朋友可以了解下2020-07-07

