111,092
社区成员




Timer t = new Timer();
t.Tick += delegate
{
if (Form.ActiveForm == this)
{
//update bitmap;
}
};
Graphics g = panel1.CreateGraphics();//用控件创建
g.DrawLine(new Pen(Color.Red), new Point(15, 15), new Point(15, 100));//画
Image img = new Bitmap(500, 500);
this.BackgroundImage = img;
using (Graphics g = Graphics.FromImage(img))
{
g.DrawLine(/*...*/);
g.Save();
}
protected override void OnPaintBackground(PaintEventArgs e)
{
// 注释 base.OnPaintBackground(e);
e.Graphics.DrawRectangle(Pens.Black, 0, 0, 100, 100);
}