如何制定一个弧形,从半径和内部的角度在Silverlight
-
21-09-2019 - |
题
在silverlight3项目,我要画一个弧通过程序和我有半径圈内角的弧形。可以请你直接给我一些相关的文章。
谢谢你在期待!
哈里斯
解决方案
这似乎是一个很好的文章上的建筑弧动态 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并且还角度θ。应该建立起点系列。
其他提示
使用的表达混合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>
不隶属于 StackOverflow