<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="TestProject"
FontFamily="나눔고딕코딩"
FontSize="16">
<Window.Resources>
<DrawingBrush x:Key="BlueGridDrawingBrushKey"
ViewportUnits="Absolute"
Viewport="0 0 10 10"
TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="White">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0 0 1 1" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing
Brush="#ccccff"
Geometry="M 0 0 L 1 0 1 0.1 0 0.1 Z" />
<GeometryDrawing
Brush="#ccccff"
Geometry="M 0 0 L 0 1 0.1 1 0.1 0 Z" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="GreenGridDrawingBrushKey"
ViewportUnits="Absolute"
Viewport="0 0 10 10"
TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="White">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0 0 1 1" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing
Brush="Lime"
Geometry="M 0 0 L 1 0 1 0.1 0 0.1 Z" />
<GeometryDrawing
Brush="Lime"
Geometry="M 0 0 L 0 1 0.1 1 0.1 0 Z" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
</Window.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0">
<Bold>Interactive MatrixTransform Example</Bold>
</TextBlock>
<Grid Grid.Row="1"
Margin="0 10 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0">M11</Label>
<TextBox Name="m11TextBox" Grid.Row="0" Grid.Column="1"
Width="50"
Height="25"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Right">
1.0
</TextBox>
<Label Grid.Row="0" Grid.Column="2"
Margin="10 0 0 0">
M21
</Label>
<TextBox Name="m21TextBox" Grid.Row="0" Grid.Column="3"
Width="50"
Height="25"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Right">
0.0
</TextBox>
<Label Grid.Row="1" Grid.Column="0"
Margin="0 10 0 0">
M12
</Label>
<TextBox Name="m12TextBox" Grid.Row="1" Grid.Column="1"
Margin="0 10 0 0"
Width="50"
Height="25"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Right">
0.0
</TextBox>
<Label Grid.Row="1" Grid.Column="2"
Margin="10 10 0 0">M22</Label>
<TextBox Name="m22TextBox" Grid.Row="1" Grid.Column="3"
Margin="0 10 0 0"
Width="50"
Height="25"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Right">
1.0
</TextBox>
<Label Grid.Row="2" Grid.Column="0"
Margin="0 10 0 0">
OffsetX
</Label>
<TextBox Name="offsetXTextBox" Grid.Row="2" Grid.Column="1"
Margin="0 10 0 0"
Width="50"
Height="25"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Right">
0.0
</TextBox>
<Label Grid.Row="2" Grid.Column="2"
Margin="10 10 0 0">
OffsetY
</Label>
<TextBox Name="offsetYTextBox" Grid.Row="2" Grid.Column="3"
Margin="0 10 0 0"
Width="50"
Height="25"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Right">
0.0
</TextBox>
<Button Name="applyButton" Grid.Row="3" Grid.Column="0"
Margin="0 10 0 0"
Width="100"
Height="30">
Apply
</Button>
<Grid Grid.Column="4" Grid.Row="0" Grid.RowSpan="4"
Margin="30 0">
<Grid.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
HorizontalAlignment="Left"
Width="10"
Height="1"
Fill="Black" />
<Rectangle Grid.Row="0" Grid.RowSpan="6" Grid.Column="0"
Width="1"
Fill="Black" />
<Rectangle Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2"
HorizontalAlignment="Left"
Width="10"
Height="1"
Fill="Black" />
<TextBlock Grid.Row="1" Grid.Column="1"
Margin="10">
<TextBlock.Text>
<Binding ElementName="m11TextBox" Path="Text" />
</TextBlock.Text>
</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="2"
Margin="10">
<TextBlock.Text>
<Binding ElementName="m21TextBox" Path="Text" />
</TextBlock.Text>
</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="3"
Margin="10">
0.0
</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1"
Margin="10">
<TextBlock.Text>
<Binding ElementName="m12TextBox" Path="Text" />
</TextBlock.Text>
</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="2"
Margin="10">
<TextBlock.Text>
<Binding ElementName="m22TextBox" Path="Text" />
</TextBlock.Text>
</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="3"
Margin="10">
0.0
</TextBlock>
<TextBlock Grid.Row="3" Grid.Column="1"
Margin="10">
<TextBlock.Text>
<Binding ElementName="offsetXTextBox" Path="Text" />
</TextBlock.Text>
</TextBlock>
<TextBlock Grid.Row="3" Grid.Column="2"
Margin="10">
<TextBlock.Text>
<Binding ElementName="offsetYTextBox" Path="Text" />
</TextBlock.Text>
</TextBlock>
<TextBlock Grid.Row="3" Grid.Column="3"
Margin="10">
1.0
</TextBlock>
<Rectangle Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="2"
HorizontalAlignment="Right"
Width="10"
Height="1"
Fill="Black" />
<Rectangle Grid.Row="0" Grid.RowSpan="6" Grid.Column="4"
Width="1"
Fill="Black" />
<Rectangle Grid.Row="5" Grid.Column="3" Grid.ColumnSpan="2"
HorizontalAlignment="Right"
Width="10"
Height="1"
Fill="Black" />
</Grid>
</Grid>
<Border Grid.Row="2"
Margin="0 10 0 0"
BorderThickness="2"
BorderBrush="Black">
<Canvas Background="{StaticResource BlueGridDrawingBrushKey}">
<TextBlock Canvas.Left="80" Canvas.Top="80">
Before Transform
</TextBlock>
<Rectangle Canvas.Left="100" Canvas.Top="100"
Width="100"
Height="100"
StrokeThickness="2"
Stroke="Black"
StrokeDashArray="2 1"
Fill="{StaticResource BlueGridDrawingBrushKey}"
Opacity="0.50" />
<Rectangle Name="transformedRectangle" Canvas.Left="100" Canvas.Top="100"
Width="100"
Height="100"
StrokeThickness="2"
Stroke="Black"
Fill="{StaticResource GreenGridDrawingBrushKey}">
<Rectangle.RenderTransform>
<MatrixTransform x:Name="targetMatrixTransform" />
</Rectangle.RenderTransform>
</Rectangle>
</Canvas>
</Border>
</Grid>
</Window>