如何填充两行之间的区域GDI C# [英] How to fill region between two lines GDI C#

查看:84
本文介绍了如何填充两行之间的区域GDI C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用c#填写ac#graphics中两行之间的区域。





我正在使用drawlines方法绘制两条曲线



I want to fill region between two lines in in a c# graphics using c#.


i'm using drawlines method to draw the two curves

points.Add(new PointF(x + left, (float)y + trackHeight));



.. 。


...

if (points.Count > 1)
    {
      using (Pen pen = HandlerGraphs.GetPen(log.LineStyle, log.Brush, 2))
         {
           gr.DrawLines(pen, points.ToArray());
          }
 }





填充区域,我试过





for fill region, i tried

gr.FillClosedCurve(new SolidBrush(log.leftColorShading), leftPoints.ToArray(), FillMode.Alternate);





[ ^ ]



但需要超过两分钟(我的曲线由13255点组成)



任何想法?



[^]

but that take more than two minuts (my curve is composed from 13255 point)

any idea?

推荐答案

不,不要填充闭合曲线;相反,建立并填充该地区:

https://msdn.microsoft.com/en-us/library/system.drawing.graphics.fillregion%28v=vs.110%29.aspx [ ^ ],

https: //msdn.microsoft.com/en-us/library/system.drawing.region%28v=vs.110%29.aspx [ ^ ]。



-SA
No, don't fill closed curve; instead, build and fill the region:
https://msdn.microsoft.com/en-us/library/system.drawing.graphics.fillregion%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/system.drawing.region%28v=vs.110%29.aspx[^].

—SA


这篇关于如何填充两行之间的区域GDI C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆