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 WindowsFormsApplication1
{
public partial class graphics : Form
{
int origin=0;
Random myRandom = new Random();
int i = 1;
Point[] Points = new Point[16];
bool Ctrl = false;
public graphics()
{
InitializeComponent();
}
private void Form3_Load(object sender, EventArgs e)
{
origin = this.Height/2;
}
//模拟
private void toolStripButton1_Click(object sender, EventArgs e)
{
drawTable();
}
private void drawTable()
{
this.Refresh();
Pen myPen = new Pen(Color.Gray, 1);//实例化画笔对象
Graphics myGra = this.CreateGraphics();//确定作画的
C#绘制折线图
最新推荐文章于 2022-05-27 14:17:06 发布
这篇博客介绍如何使用C#在Windows Forms应用程序中绘制折线图,并实现动态更新。通过创建Graphics对象,利用Pen和Point类,结合Random类生成随机数,实现了静态和动态的折线图绘制。在动态模式下,通过Timer控件更新折线图的点坐标,产生平移效果。
摘要由CSDN通过智能技术生成