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 GdiPractic
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)//窗体加载的时候不画
{
//Graphics g = new Graphics();//这里图像对象的初始化不能使用new的形式
//Graphics g = this.CreateGraphics();//必须在初始化一个图像对象的时候,必须关联一个图像输出的设备
//g.DrawLine(Pens.Red, 0, 0, 100, 100);
}
private void button1_Click(object sender, EventArgs e)
{
//Graphics g = new Graphics();//这里图像对象的初始化不能使用new的形式