-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
49 lines (43 loc) · 3.21 KB
/
MainWindow.xaml
File metadata and controls
49 lines (43 loc) · 3.21 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
<Window x:Class="binarization.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:binarization"
mc:Ignorable="d"
Title="MainWindow" Height="550" Width="1000">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="2"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" HorizontalAlignment="Stretch" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Content="Threshold" Width="200" Height="30" Grid.Row="0" Margin="0,10,0,0" Click="Choose_Binarization" CommandParameter="{x:Static local:BinarizationType.Threshold}"/>
<Button Content="Niblack" Width="200" Height="30" Grid.Row="1" Margin="0,10,0,0" Click="Choose_Binarization" CommandParameter="{x:Static local:BinarizationType.Niblack}"/>
<Button Content="Sauvoli" Width="200" Height="30" Grid.Row="2" Margin="0,10,0,0" Click="Choose_Binarization" CommandParameter="{x:Static local:BinarizationType.Sauvola}"/>
<Button Content="Phansalkar" Width="200" Height="30" Grid.Row="3" Margin="0,10,0,0" Click="Choose_Binarization" CommandParameter="{x:Static local:BinarizationType.Phansalkara}"/>
<Button Content="Otsu" Width="200" Height="30" Grid.Row="4" Margin="0,10,0,0" Click="Choose_Binarization" CommandParameter="{x:Static local:BinarizationType.Otsu}"/>
<Button Content="Load Image" Width="200" Height="30" Grid.Row="6" Margin="0,10,0,0" Click="LoadImage_Click"/>
<Button Content="Reset Image" Width="200" Height="30" Grid.Row="7" Margin="0,10,0,0" Click="ResetImage_Click"/>
</Grid>
<Line X1="220" Y1="0" X2="220" Y2="550" Stroke="Gray" StrokeThickness="2" VerticalAlignment="Stretch"/>
<Image x:Name="DisplayedImage" Grid.Column="2" Width="550" Height="400" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10, 10, 10, 40" Stretch="Uniform"/>
<StackPanel x:Name="WindowSizeStackPanel" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,5" Visibility="Collapsed">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBox x:Name="NumberTextBox" Width="100" PreviewTextInput="NumberValidationTextBox" TextChanged="TextChangeTextBox" Margin="0 , 0, 5, 0" />
<Button Content="Apply" Width="100" Height="30" Click="Apply_Binarization"/>
</StackPanel>
</StackPanel>
</Grid>
</Window>