首页 > Windows开发 > 详细

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

时间:2018-09-27 15:06:44      阅读:164      评论:0      收藏:0      [点我收藏+]

 

一、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);
}

 

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

原文:https://www.cnblogs.com/anglewang/p/9712933.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!