在C#中的图形上绘制半圆以及刻度值 [英] Drawing a Semi circle on a Graph in C# along with scale values
本文介绍了在C#中的图形上绘制半圆以及刻度值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在图表中使用比例值C#绘制x轴范围内的半圆。任何人都可以帮助我如何进行相同的操作。
例如,如果我的x轴范围从-1到1,则半圆将从-1到+1绘制,0为中心。
I want to draw a semi circle within the range of x-Axis in a graph with scale values C#. Can anyone help me how to proceed the same.
For eg if my x axis ranges from -1 to 1 then a semi circle is to be drawn from -1 to +1 with 0 as centre.
推荐答案
由于Graphics.DrawCircle(AFAIK)不支持仅绘制一个圆的一部分,因此您将不得不诉诸 GraphicsPath [ ^ ]。实例化之后,您可以使用 AddArc之一将其设为半圆形。 () [ ^ ]重载。然后,使用 Graphics.DrawPath()绘制它。 [ ^ ]方法。
Since Graphics.DrawCircle (AFAIK) doesn't support drawing just a segment of a circle, you will have to resort to GraphicsPath[^]. After instantiating one, you can make it your semi-circle using one of the AddArc()[^] overloads. Then, draw it using the Graphics.DrawPath()[^] method.
这篇关于在C#中的图形上绘制半圆以及刻度值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文