怎样用c#画图?
刚开始接触用C#画图,但貌似在Windows应用程序中画不成啊!同学告诉说只能在Web中才能画图,真是这样吗?
可怎样才能让我画的图形显示出来了??试了几次,在WINDOWS应用程序中还是不能显示出来,请高手指点!全部代码如下:
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace pcture_test1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Graphics g = this.CreateGraphics();
Pen pen = new Pen(Color.Red,5);
g.DrawLine(pen, new Point(0, 0), new Point(100, 100));
}
}
}