첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.

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"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    Width="800"
    Height="600"
    Title="RotateTransform 엘리먼트 : 좌우대칭 반사 텍스트 회전하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Canvas>
        <Canvas.Resources>
            <FontFamily x:Key="FontFamilyKey">Times New Roman</FontFamily>
            <s:Double x:Key="FontSizeDoubleKey">96</s:Double>
            <TransformGroup x:Key="TransformGroupKey">
                <ScaleTransform ScaleX="{Binding Source={StaticResource FontFamilyKey}, Path=Baseline}" />
                <ScaleTransform ScaleX="{StaticResource FontSizeDoubleKey}" />
            </TransformGroup>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="FontFamily"  Value="{StaticResource FontFamilyKey}"     />
                <Setter Property="FontSize"    Value="{StaticResource FontSizeDoubleKey}" />
                <Setter Property="Text"        Value="Reflect" />
                <Setter Property="Canvas.Left" Value="288"     />
                <Setter Property="Canvas.Top"  Value="192"     />
            </Style>
        </Canvas.Resources>
        <TextBlock>
            <TextBlock.RenderTransform>
                <RotateTransform
                    Angle="45"
                    CenterY="{Binding Source={StaticResource TransformGroupKey}, Path=Value.M11}" />
            </TextBlock.RenderTransform>
        </TextBlock>
        <TextBlock>
            <TextBlock.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="-1" />
                    <RotateTransform
                        Angle="45"
                        CenterY="{Binding Source={StaticResource TransformGroupKey}, Path=Value.M11}" />
                </TransformGroup>
            </TextBlock.RenderTransform>
        </TextBlock>
        <TextBlock>
            <TextBlock.RenderTransform>
                <TransformGroup>
                    <ScaleTransform
                        ScaleY="-1"
                        CenterY="{Binding Source={StaticResource TransformGroupKey}, Path=Value.M11}" />
                    <RotateTransform
                        Angle="45"
                        CenterY="{Binding Source={StaticResource TransformGroupKey}, Path=Value.M11}" />
                </TransformGroup>
            </TextBlock.RenderTransform>
        </TextBlock>
        <TextBlock>
            <TextBlock.RenderTransform>
                <TransformGroup>
                    <ScaleTransform
                        ScaleX="-1"
                        ScaleY="-1"
                        CenterY="{Binding Source={StaticResource TransformGroupKey}, Path=Value.M11}" />
                    <RotateTransform
                        Angle="45"
                        CenterY="{Binding Source={StaticResource TransformGroupKey}, Path=Value.M11}" />
                </TransformGroup>
            </TextBlock.RenderTransform>
        </TextBlock>
    </Canvas>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요