(C#)GDI+简单绘图画矩形

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

namespace _10._2._4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Pen pen = new Pen(Color.Tomato, 4);
            g.DrawRectangle(pen, 20, 20, 200, 220);
            Brush brush = new SolidBrush(Color.SpringGreen);
            g.FillRectangle(brush, 230, 20, 200, 220);
        }
    }
}


posted @ 2012-11-22 15:52  Finlay Liu  阅读(1006)  评论(0编辑  收藏  举报