質問

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

期待してありがとう!

ハリス

役に立ちましたか?

解決

これは<のhref =「http://codingbandit.com/Blog/blog/dynamically-creating-path-data-in-silverlight-2/」のrel = "nofollowを動的に弧を構築するには良い記事をのようですnoreferrer "> 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と角度θを持っています。これは、点列を構築する必要があります。

他のヒント

あなたはSilverlightで、特にArcSegments部のパスを見てみたいとしている。

ArcSegmentドキュメント

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

エクスプレッション ブレンド 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>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top