在Silverlight 3項目中,我必須以編程方式繪製弧線,並且我有圓弧的半徑和弧線的內角。你能否指導我參閱一些相關文章。如何從半徑和內角度在Silverlight中繪製弧線
感謝您的期待!
哈里斯
在Silverlight 3項目中,我必須以編程方式繪製弧線,並且我有圓弧的半徑和弧線的內角。你能否指導我參閱一些相關文章。如何從半徑和內角度在Silverlight中繪製弧線
感謝您的期待!
哈里斯
這似乎是在建築圓弧的好文章動態http://codingbandit.com/Blog/blog/dynamically-creating-path-data-in-silverlight-2/
要計算使用下列公式的點。
x = a + r * cos(θ)
y = b + r * sin(θ)
* r is the radius of the circle
* (a,b) is the center of the circle
* (x,y) is the point on the circumference
* θ is the angle in degrees
* radian = degree * π/180
你有半徑r和角度θ。這應該建立點系列。
With Expression Blend 4。你可以使用Arc
。
實施例:
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
x:Class="SilverlightApplication1.MainPage"
Width="640" Height="480">
<Grid x:Name="LayoutRoot" Background="White">
<Canvas Margin="101,88,118,125">
<ed:Arc ArcThickness="0" ArcThicknessUnit="Pixel" EndAngle="90" Fill="#FFF4F4F5" Height="60" Canvas.Left="101" Stretch="None" Stroke="Black" StartAngle="0" Canvas.Top="63" UseLayoutRounding="False" Width="57"/>
</Canvas>
</Grid>
</UserControl>