2

Silverlight 3 プロジェクトでは、プログラムで弧を描く必要があり、円の半径と弧の内角があります。関連記事をいくつか教えてください。

期待してありがとう!

ハリス

4

3 に答える 3

3

これは、弧を動的に構築することに関する良い記事のようです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 と角度 θ があります。これでポイントシリーズが構築されます。

于 2010-02-19T15:37:57.760 に答える
2

Silverlight のパス、特に ArcSegments セクションを確認する必要があります。

ArcSegment ドキュメント

MSDN パス ジオメトリのサンプル

于 2010-02-19T14:12:17.883 に答える
1

エクスプレッション ブレンドを使用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>
于 2011-01-20T13:45:27.233 に答える