【问题标题】:How to draw an arc from radius and inner angle in Silverlight如何在 Silverlight 中从半径和内角绘制圆弧
【发布时间】:2014-05-15 02:22:04
【问题描述】:

在 silverlight 3 项目中,我必须以编程方式绘制圆弧,并且我有圆的半径和圆弧的内角。请您指导我看一些相关的文章。

感谢期待!

哈里斯

【问题讨论】:

    标签: silverlight silverlight-3.0 drawing geometry geometric-arc


    【解决方案1】:

    这似乎是一篇关于动态构建弧线的好文章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 和角度 θ。这应该建立点系列。

    【讨论】:

      【解决方案2】:

      您将要查看 Silverlight 中的路径,特别是 ArcSegments 部分。

      ArcSegment Documentation

      MSDN Path Geometry Samples

      【讨论】:

        【解决方案3】:

        使用 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>
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-07-08
          • 2021-10-16
          • 1970-01-01
          • 1970-01-01
          • 2017-06-06
          • 1970-01-01
          • 1970-01-01
          • 2016-03-18
          相关资源
          最近更新 更多