I'm trying to get drawing on C# Form working, but after reading documentation about Graphics class and Draw/Fill methods It still doesn't work for me.
It's the code:
using System.Drawing;
using System.Windows.Forms;
namespace Drawing_Example
{
public partial class Form1 : Form
{
#region Constructors
public Form1()
{
InitializeComponent();
Pen pen = new Pen(Color.Black, 3f);
Graphics surface = CreateGraphics();
surface.DrawEllipse(pen, new Rectangle(0, 0, 200, 300));
pen.Dispose();
surface.Dispose();
}
#endregion Constructors
}
}
When I press Start an empty form appears, no drawings. Can you tell me what I'm doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…