첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

728x90
반응형

■ Polygon 엘리먼트 : 별(star) 그리기

------------------------------------------------------------------------------------------------------------------------


TestProject.zip


MainWindow.xaml

 

 

<Window x:Class="TestProject.MainWindow"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Width="800"

    Height="600"

    Title="Polygon 엘리먼트 : 별(star) 그리기"

    FontFamily="나눔고딕코딩"

    FontSize="16">

    <Grid>

        <Canvas>

            <Polygon Name="polygon" Canvas.Left="100" Canvas.Top="100"

                Width="20"

                Height="20"

                Stroke="Black"

                StrokeThickness="1"

                StrokeLineJoin="Round"

                Fill="Yellow"

                Stretch="Fill"

                Points="9 2 11 7 17 7 12 10 14 15 9 12 4 15 6 10 1 7 7 7"

                Visibility="Visible">

                <Polygon.RenderTransform>

                    <TransformGroup>

                        <ScaleTransform

                            ScaleX="10"

                            ScaleY="10" />

                        <RotateTransform x:Name="rotateTransform"

                            CenterX="100"

                            CenterY="100" />

                    </TransformGroup>

                </Polygon.RenderTransform>

                <Polygon.Triggers>

                    <EventTrigger RoutedEvent="Polygon.Loaded">

                        <BeginStoryboard>

                            <Storyboard>

                                <DoubleAnimation

                                    Storyboard.TargetName="rotateTransform"

                                    Storyboard.TargetProperty="Angle"

                                    From="0"

                                    To="360"

                                    Duration="00:00:10"

                                    RepeatBehavior="Forever" />

                            </Storyboard>

                        </BeginStoryboard>

                    </EventTrigger>

                </Polygon.Triggers>

            </Polygon>

        </Canvas>

    </Grid>

</Window>

 

------------------------------------------------------------------------------------------------------------------------

728x90
반응형
Posted by 사용자 icodebroker

댓글을 달아 주세요