-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
85 lines (81 loc) · 5.56 KB
/
MainWindow.xaml
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
<Window x:Class="ImageMerger.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:ImageMerger"
mc:Ignorable="d"
Title="Image Merger" Height="660" Width="600" WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5,0,5">
<Button Click="MergeImages" Content="Merge Images" Name="Merge_Images" Margin="0,0,5,0" Padding="5,1,5,1" ToolTip="Merge 'source images' with 'merge images' into 'target images'">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Loaded">
<BeginStoryboard>
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Merge_Images" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" Duration="0:0:1" RepeatBehavior="4x">
<ColorAnimationUsingKeyFrames.KeyFrames>
<LinearColorKeyFrame Value="LightPink" KeyTime="0:0:0.5" />
<LinearColorKeyFrame Value="LightGray" KeyTime="0:0:1" />
</ColorAnimationUsingKeyFrames.KeyFrames>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
<Button x:Name="ShowImagesButton" Click="ShowImages" Content="Show Merged Images" IsEnabled="False" Margin="0,0,5,0" Padding="5,1,5,1" ToolTip="Watch the 'target images' stacked on top of each other"/>
<Button x:Name="SaveImagesButton" Click="SaveImages" Content="Save Merged Images" IsEnabled="False" Margin="0,0,5,0" Padding="5,1,5,1" ToolTip="Save the 'target images' to a PDF file"/>
<Button Click="ResetImages" Content="Reset Images" Padding="5,1,5,1" ToolTip="Reset all displayed images to their default values"/>
</StackPanel>
<Viewbox Grid.Row="1">
<Grid Grid.IsSharedSizeScope="True" ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition SharedSizeGroup="A"/>
<RowDefinition SharedSizeGroup="A"/>
<RowDefinition SharedSizeGroup="A"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition SharedSizeGroup="B"/>
<ColumnDefinition SharedSizeGroup="B"/>
<ColumnDefinition SharedSizeGroup="B"/>
</Grid.ColumnDefinitions>
<Viewbox Grid.Row="0" Grid.Column="0">
<Label Content="Source images" HorizontalAlignment="Center" VerticalAlignment="Center">
<Label.LayoutTransform>
<RotateTransform Angle="-90" />
</Label.LayoutTransform>
</Label>
</Viewbox>
<Viewbox Grid.Row="1" Grid.Column="0">
<Label Content="Merge images" HorizontalAlignment="Center" VerticalAlignment="Center">
<Label.LayoutTransform>
<RotateTransform Angle="-90" />
</Label.LayoutTransform>
</Label>
</Viewbox>
<Viewbox Grid.Row="2" Grid.Column="0">
<Label Content="Target images" HorizontalAlignment="Center" VerticalAlignment="Center">
<Label.LayoutTransform>
<RotateTransform Angle="-90" />
</Label.LayoutTransform>
</Label>
</Viewbox>
<Image x:Name="Image00" Grid.Row="0" Grid.Column="1" Width="200" Source="pack://application:,,,/Images/Image00.jpg" MouseLeftButtonUp="Image_Click"/>
<Image x:Name="Image01" Grid.Row="0" Grid.Column="2" Width="200" Source="pack://application:,,,/Images/Image01.jpg" MouseLeftButtonUp="Image_Click"/>
<Image x:Name="Image02" Grid.Row="0" Grid.Column="3" Width="200" Source="pack://application:,,,/Images/Image02.jpg" MouseLeftButtonUp="Image_Click"/>
<Image x:Name="Image03" Grid.Row="1" Grid.Column="1" Width="200" Source="pack://application:,,,/Images/Image03.jpg" MouseLeftButtonUp="Image_Click"/>
<Image x:Name="Image04" Grid.Row="1" Grid.Column="2" Width="200" Source="pack://application:,,,/Images/Image04.jpg" MouseLeftButtonUp="Image_Click"/>
<Image x:Name="Image05" Grid.Row="1" Grid.Column="3" Width="200" Source="pack://application:,,,/Images/Image05.jpg"/>
<Image x:Name="Image06" Grid.Row="2" Grid.Column="1" Width="200" Source="pack://application:,,,/Images/Image06.jpg"/>
<Image x:Name="Image07" Grid.Row="2" Grid.Column="2" Width="200" Source="pack://application:,,,/Images/Image07.jpg"/>
<Image x:Name="Image08" Grid.Row="2" Grid.Column="3" Width="200" Source="pack://application:,,,/Images/Image08.jpg"/>
</Grid>
</Viewbox>
</Grid>
</Window>