繁体   English   中英

具有高性能面板的C#3D图

[英]C# 3D plot with panel on high performance

我必须使用C#中的面板在3d中绘制一些数学函数。 进行高性能绘图的最佳方法是什么? 现在,我计算点的坐标,并使用DrawPolygon方法绘制一些具有不同形式和颜色的多边形,但是该图闪烁且缓慢。 功能完成后,是否应该延迟面板的更新?

for (int i = 0; i < nIteration-1; i++)
{
     for (int j = 0; j < nIteration-1; j++)
     {
          // Polygon points 
          draw[0] = points[i + 1][j];
          draw[1] = points[i][j];
          draw[2] = points[i][j + 1];
          draw[3] = points[i+1][j+1]; 

          // Color gradint
          brush = new LinearGradientBrush(rect,
                  color[i][j],
                  color[i + 1][j + 1], LinearGradientMode.Vertical);

          // Polygon coloured
          graph.SmoothingMode = SmoothingMode.None;
          graph.FillPolygon(brush, draw);

          // Polygon black border
          graph.SmoothingMode = SmoothingMode.AntiAlias;
          graph.DrawPolygon(pen, draw);
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM