-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
126 lines (126 loc) · 8.66 KB
/
MainWindow.xaml
File metadata and controls
126 lines (126 loc) · 8.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<Window x:Class="VisiMatrix.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Video layout matrix editor" Height="350" Width="525"
DataContext="{StaticResource Holder}" Loaded="Window_Loaded">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Canvas Grid.Row="1" Grid.Column="1">
<MediaElement IsMuted="True" Name="Media" LoadedBehavior="Manual" UnloadedBehavior="Manual"
Width="{Binding Text, ElementName=BoxWidth}"
Height="{Binding Text, ElementName=BoxHeight}" >
<MediaElement.RenderTransform>
<MatrixTransform Matrix="{Binding Matrix}"/>
</MediaElement.RenderTransform>
</MediaElement>
<Rectangle Fill="Blue" Name="BlueForeground"
Width="{Binding Text, ElementName=BoxWidth}"
Height="{Binding Text, ElementName=BoxHeight}">
<Rectangle.RenderTransform>
<MatrixTransform Matrix="{Binding Matrix}"/>
</Rectangle.RenderTransform>
</Rectangle>
</Canvas>
<TextBlock Grid.Column="0" Grid.Row="0" Padding="3,0" HorizontalAlignment="Right" >-Y</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="0" Padding="3,0" HorizontalAlignment="Right" VerticalAlignment="Bottom">+X</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="0" Padding="3,0" HorizontalAlignment="Left" VerticalAlignment="Bottom">-X</TextBlock>
<TextBlock Grid.Column="0" Grid.Row="1" Padding="3,0" HorizontalAlignment="Right" VerticalAlignment="Bottom">+Y</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,0,2" FontSize="14">></TextBlock>
<TextBlock Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="3,0,0,-2" FontSize="14">>
<TextBlock.LayoutTransform>
<RotateTransform Angle="90"/>
</TextBlock.LayoutTransform>
</TextBlock>
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
<RadioButton Name="OptPro" IsChecked="True" Margin="3,0" Checked="OptPro_Checked">Pro mode</RadioButton>
<RadioButton Name="OptLite" IsChecked="False" Checked="OptPro_Checked">Lite mode</RadioButton>
</StackPanel>
</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label>Width</Label>
<TextBox Name="BoxWidth" Grid.Row="1" Grid.Column="0" IsEnabled="{Binding IsDirty}">160</TextBox>
<Label Grid.Column="1" Grid.Row="0">Height</Label>
<TextBox Name="BoxHeight" Grid.Row="1" Grid.Column="1" IsEnabled="{Binding IsDirty}">90</TextBox>
<!---->
<Label Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Name="TransformLabel1">Transformation (read-only)</Label>
<TextBox Name="BoxM11" Grid.Row="3" Grid.Column="0" IsReadOnly="True" Text="{Binding Matrix.M11}" Background="LightGray"/>
<TextBox Name="BoxM12" Grid.Row="3" Grid.Column="1" IsReadOnly="True" Text="{Binding Matrix.M12}" Background="LightGray"/>
<TextBox Name="BoxM21" Grid.Row="4" Grid.Column="0" IsReadOnly="True" Text="{Binding Matrix.M21}" Background="LightGray"/>
<TextBox Name="BoxM22" Grid.Row="4" Grid.Column="1" IsReadOnly="True" Text="{Binding Matrix.M22}" Background="LightGray"/>
<TextBox Name="BoxTx" Grid.Row="5" Grid.Column="0" IsReadOnly="True" Text="{Binding Matrix.OffsetX}" Background="LightGray"/>
<TextBox Name="BoxTy" Grid.Row="5" Grid.Column="1" IsReadOnly="True" Text="{Binding Matrix.OffsetY}" Background="LightGray"/>
<!---->
<Label Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2" Name="TransformLabel2">Transformation (actions)</Label>
<TextBox Name="BoxRotate" Grid.Row="7" Grid.Column="0" IsEnabled="{Binding IsDirty}">0</TextBox>
<Button Name="BtnRotate" Grid.Row="7" Grid.Column="1" Content="Rotate" Click="BtnRotate_Click" IsEnabled="{Binding IsDirty}"/>
<Grid Grid.Row="8" Grid.Column="0" Name="ScaleBoxes" IsEnabled="{Binding IsDirty}">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBox Name="BoxScaleX" Grid.Row="0" Grid.Column="0">0</TextBox>
<TextBox Name="BoxScaleY" Grid.Row="0" Grid.Column="1">0</TextBox>
</Grid>
<Button Name="BtnScale" Grid.Row="8" Grid.Column="1" Content="Scale" Click="BtnScale_Click" IsEnabled="{Binding IsDirty}"/>
<Grid Grid.Row="9" Grid.Column="0" Name="SkewBoxes" IsEnabled="{Binding IsDirty}">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBox Name="BoxSkewX" Grid.Row="0" Grid.Column="0">0</TextBox>
<TextBox Name="BoxSkewY" Grid.Row="0" Grid.Column="1">0</TextBox>
</Grid>
<Button Name="BtnSkew" Grid.Row="9" Grid.Column="1" Content="Skew" Click="BtnSkew_Click" IsEnabled="{Binding IsDirty}"/>
<Grid Grid.Row="10" Grid.Column="0" Name="TranslateBoxes" IsEnabled="{Binding IsDirty}">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBox Name="BoxTranslateX" Grid.Row="0" Grid.Column="0">0</TextBox>
<TextBox Name="BoxTranslateY" Grid.Row="0" Grid.Column="1">0</TextBox>
</Grid>
<Button Name="BtnLiteRot90" IsEnabled="{Binding IsDirty}" Grid.Row="10" Grid.Column="0" Content="Rotate 90°" Visibility="Collapsed" Click="BtnLiteRot90_Click"/>
<Button Name="BtnTranslate" IsEnabled="{Binding IsDirty}" Grid.Row="10" Grid.Column="1" Content="Translate" Click="BtnTranslate_Click"/>
<Button Name="BtnLiteRot180" IsEnabled="{Binding IsDirty}" Grid.Row="10" Grid.Column="1" Content="Rotate 180°" Visibility="Collapsed" Click="BtnLiteRot180_Click"/>
<Button Name="BtnLiteRot270" IsEnabled="{Binding IsDirty}" Grid.Row="11" Grid.Column="0" Content="Rotate 270°" Visibility="Collapsed" Click="BtnLiteRot270_Click"/>
<Button Name="BtnReset" IsEnabled="{Binding IsDirty}" Grid.Row="11" Grid.Column="1" Content="Reset Layout" Click="BtnReset_Click" />
<!---->
<Button Name="BtnOpen" Grid.Row="12" Grid.Column="0" Content="Open" Click="BtnOpen_Click" />
<Button Name="BtnSave" IsEnabled="{Binding IsDirty}" Grid.Row="12" Grid.Column="1" Content="Save" Click="BtnSave_Click" />
<Label Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="2" Visibility="Hidden" Name="SaveLabel" HorizontalContentAlignment="Center" Foreground="#FF57E82C" FontWeight="Bold">Successfully saved</Label>
<Label Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="2" Visibility="Hidden" Name="SaveFailLabel" HorizontalContentAlignment="Center" Foreground="#FFF30B0B" FontWeight="Bold">File in use, try again later</Label>
</Grid>
</Grid>
</Window>