Tag: 绘图图片

在PictureBox上绘图

在UserControl我有一个PictureBox和一些其他控件。 对于包含名为Graph此图片框的用户控件,我有一种在此图片框上绘制曲线的方法: //Method to draw X and Y axis on the graph private bool DrawAxis(PaintEventArgs e) { var g = e.Graphics; g.DrawLine(_penAxisMain, (float)(Graph.Bounds.Width / 2), 0, (float)(Graph.Bounds.Width / 2), (float)Bounds.Height); g.DrawLine(_penAxisMain, 0, (float)(Graph.Bounds.Height / 2), Graph.Bounds.Width, (float)(Graph.Bounds.Height / 2)); return true; } //Painting the Graph private void Graph_Paint(object sender, PaintEventArgs e) { base.OnPaint(e); DrawAxis(e); } […]