첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

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="Shape 클래스 : 펜 사용하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="150" />
            <RowDefinition Height="5"   />
            <RowDefinition Height="*"   />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="5"    />
                <RowDefinition Height="*"    />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.Column="0">_Thickness</Label>
            <Slider Name="thicknessSlider" Grid.Row="2" Grid.Column="0"
                Minimum="0"
                Maximum="100"
                Value="24" />
            <Label Grid.Row="0" Grid.Column="2">_StartLineCap</Label>
            <ListBox Name="startLineCapListBox" Grid.Row="2" Grid.Column="2">
                <ListBoxItem Content="{x:Static PenLineCap.Flat    }" />
                <ListBoxItem Content="{x:Static PenLineCap.Square  }" />
                <ListBoxItem Content="{x:Static PenLineCap.Round   }" />
                <ListBoxItem Content="{x:Static PenLineCap.Triangle}" />
            </ListBox>
            <Label Grid.Row="0" Grid.Column="4">_EndLineCap</Label>
            <ListBox Name="endLineCapListBox" Grid.Row="2" Grid.Column="4">
                <ListBoxItem Content="{x:Static PenLineCap.Flat    }" />
                <ListBoxItem Content="{x:Static PenLineCap.Square  }" />
                <ListBoxItem Content="{x:Static PenLineCap.Round   }" />
                <ListBoxItem Content="{x:Static PenLineCap.Triangle}" />
            </ListBox>
            <Label Grid.Row="0" Grid.Column="6">_LineJoin</Label>
            <ListBox Name="ineJoinListBox" Grid.Row="2" Grid.Column="6">
                <ListBoxItem Content="{x:Static PenLineJoin.Bevel}" />
                <ListBoxItem Content="{x:Static PenLineJoin.Round}" />
                <ListBoxItem Content="{x:Static PenLineJoin.Miter}" />
            </ListBox>
            <Label Grid.Row="0" Grid.Column="8">_MiterLimit</Label>
            <Slider Name="miterLimitSlider" Grid.Row="2" Grid.Column="8"
                Minimum="0"
                Maximum="100"
                Value="10" />
        </Grid>
        <Polyline Grid.Row="2"
            Points="0 0 500 25 0 50"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Stroke="Blue"
            StrokeThickness="{Binding ElementName=thicknessSlider, Path=Value }"
            StrokeStartLineCap="{Binding ElementName=startLineCapListBox, Path=SelectedItem.Content}"
            StrokeEndLineCap="{Binding ElementName=endLineCapListBox, Path=SelectedItem.Content}"
            StrokeLineJoin="{Binding ElementName=lineJoinListBox, Path=SelectedItem.Content}"
            StrokeMiterLimit="{Binding ElementName=miterLimitSlider, Path=Value }" />
    </Grid>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요