110,566
社区成员
发帖
与我相关
我的任务
分享
/// <summary>
/// 刷新数据函数
/// </summary>
private void RefreshDowork()
{
float[] maxarray = new float[row];
float[] minarray = new float[row];
//cloudChartControl_NoMove1.RecHeight = (cloudChartControl_NoMove1.Height) / column;
//cloudChartControl_NoMove1.RecWidth = (cloudChartControl_NoMove1.Width) / row;
try
{
#region 坐标显示
paintX(); paintY(); paintY1(); paintY_ColorBar();
#endregion
#region 左侧显示图
n = n + 50; if (n == 500) n = 0;
//Random random = new Random();
for (int y = 0; y < 151; y++)
{
for (int x = 0; x < 241; x++)
{
this.NME._DataDisp[x, y] = (float)(n / 640f * 600f);
}
}
for (int x = 0; x < 241; x++)
{
ME._ArraryDisp[x] = (float)(n / 640f * 600f);
}
this.NME.Refresh();
this.ME.Refresh(); this.ME.Invalidate(); this.ME.Update();
MoveEnergy1.Invalidate(); MoveEnergy1.Refresh(); MoveEnergy1.Invalidate();
this.colorBar1.Refresh();
#endregion
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics grap = e.Graphics;
SolidBrush sb = new SolidBrush(Color.White);
grap.FillRectangle(sb, 0, 0, this.Width, this.Height);//填充颜色
//----数组滑动
for (int y = dataheight - 1; y > 0; y--)
{
for (int x = 0; x < datawidth; x++)
{
DataDisp[x, y] = DataDisp[x, y - 1];
}
}
for (int i = 0; i < datawidth; i++)//将显示的数据对第一行赋值
{
DataDisp[i, 0] = ArraryDisp[i];
}
//---数组数据转换为颜色显示
for (int y = 0; y < this.Height / recHeight; y++)
{
for (int x = 0; x < this.Width / recWidth; x++)
{
sb.Color = getColor((int)DataDisp[x, y]); //根据_Data值改变颜色;
grap.FillRectangle(sb, x * recWidth, y * recHeight, recWidth, recHeight);//填充颜色
}
}
}