代码改变世界

C# 绘制椭圆形

2012-06-26 10:09  Andrew.Wangxu  阅读(1360)  评论(0编辑  收藏  举报

Form1.cs 全部代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DrawEllipse
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Graphics dc = CreateGraphics();
            Show();
            Pen redPen = new Pen(Color.Red, 2);
            dc.DrawEllipse(redPen, 0, 50, 80, 60);
        }
    }
}

 

示例下载:https://files.cnblogs.com/andrew-blog/DrawEllipse.rar

参考:http://www.wxzzz.com/?id=108