一些关于c#中画图的方法技巧


 

一、c#中用到的一部分画图

 

1、画直线

  把需要画的数据点转化为对应的像素点,直接放置在对应的坐标轴上,当采集到数据时,数据直接替换原来的直线,就达到了以直线模式画数据图的目的。

  for(int i=0;i<1000;i++)

  { x1.Add(i*刻度间隔);

   x2.Add(list[i]*间隔);

  }

1、画正弦

  

for (int point = 0; point < pointCount; point++)
{

srcPoints[point].X = (double)point / pointCount * dwArea_Width;
srcPoints[point].Y = (dwArea_Height / 2 * (double)Math.Sin((double)point / pointCount * Math.PI * 2));
}

3、画椭圆

for (int point = 0; point < pointCount; point++)
{
double angle = Math.PI * point * Math.PI / pointCount;
srcPoints[point].X = dwArea_Width / 2 - (float)(dwArea_Width * Math.Cos(angle) / 2);
srcPoints[point].Y = (dwArea_Height * Math.Sin(angle) / 2);
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM