#788 – Flipping an Element Using a Scale Transform

You can flip any GUI element, either horizontally or vertically, by using a scale transform.

To flip an element horizontally, you use a ScaleTransform with a ScaleX value of -1.0.  To flip an element vertically, you use a ScaleTransform with a ScaleY value of -1.0.

    <StackPanel Orientation="Vertical">
        <Label Content="Jane Austen" Background="Thistle"
               HorizontalAlignment="Center" FontSize="16" Margin="10"/>
        <Label Content="Jane Austen" Background="Thistle"
               HorizontalAlignment="Center" FontSize="16" Margin="10">
            <Label.LayoutTransform>
                <ScaleTransform ScaleX="-1.0"/>
            </Label.LayoutTransform>
        </Label>
        <Label Content="Jane Austen" Background="Thistle"
               HorizontalAlignment="Center" FontSize="16" Margin="10">
            <Label.LayoutTransform>
                <ScaleTransform ScaleY="-1.0"/>
            </Label.LayoutTransform>
        </Label>
    </StackPanel>

788-001

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

2 Responses to #788 – Flipping an Element Using a Scale Transform

  1. Pingback: Dew Drop – April 2, 2013 (#1,518) | Alvin Ashcraft's Morning Dew

  2. Pingback: #801 – Creating a Mirror Image Using a RenderTransform | 2,000 Things You Should Know About WPF

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: