-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
61 lines (55 loc) · 3.4 KB
/
MainWindow.xaml
File metadata and controls
61 lines (55 loc) · 3.4 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
<Window x:Class="ImageViewer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Image Viewer" Height="600" Width="800">
<Grid>
<!-- Grid Layout with Two Sections -->
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<!-- Controls at the top -->
<RowDefinition Height="*" />
<!-- Expanding Image Viewer -->
</Grid.RowDefinitions>
<!-- Zoom and Pan Controls -->
<StackPanel Orientation="Vertical" Margin="10" Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" Text="Horizontal Zoom:" HorizontalAlignment="Right" Margin="10,0,0,0" />
<Slider Grid.Column="1" Grid.Row="0" Name="HorizontalZoomSlider" HorizontalAlignment="Left" Minimum="0.5" Maximum="3" Value="1" Width="150" Margin="10,0,0,0" ValueChanged="HorizontalZoomSlider_ValueChanged" />
<TextBlock Grid.Column="2" Grid.Row="0" Text="Horizontal Pan:" HorizontalAlignment="Right" Margin="10,0,0,0" />
<Slider Grid.Column="3" Grid.Row="0" Name="HorizontalPanSlider" HorizontalAlignment="Left" Minimum="0" Maximum="1" Value="0.5" Width="150" Margin="10,0,0,0" ValueChanged="HorizontalPanSlider_ValueChanged" />
<TextBlock Grid.Column="0" Grid.Row="1" Text="Vertical Zoom:" HorizontalAlignment="Right" Margin="10,0,0,0" />
<Slider Grid.Column="1" Grid.Row="1" Name="VerticalZoomSlider" HorizontalAlignment="Left" Minimum="0.5" Maximum="3" Value="1" Width="150" Margin="10,0,0,0" ValueChanged="VerticalZoomSlider_ValueChanged" />
<TextBlock Grid.Column="2" Grid.Row="1" Text="Vertical Pan:" HorizontalAlignment="Right" Margin="10,0,0,0" />
<Slider Grid.Column="3" Grid.Row="1" Name="VerticalPanSlider" HorizontalAlignment="Left" Minimum="0" Maximum="1" Value="0.5" Width="150" Margin="10,0,0,0" ValueChanged="VerticalPanSlider_ValueChanged" />
<Button Grid.Column="0" Grid.Row="2" Name="LoadImageButton" HorizontalAlignment="Right" Content="Load Image" Width="150" Click="LoadImageButton_Click" />
<CheckBox Grid.Column="1" Grid.Row="2" Name="AutoScaleCheckbox" Content="Auto Scale to Height" Checked="AutoScaleCheckbox_Checked" Unchecked="AutoScaleCheckbox_Unchecked" />
</Grid>
</StackPanel>
<!-- Responsive Image Viewer -->
<Border Grid.Row="1"
BorderBrush="Black"
BorderThickness="2"
Margin="20"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Name="ViewerBorder"
SizeChanged="ViewerBorder_SizeChanged"
ClipToBounds="True">
<Canvas Name="ImageCanvas" Background="LightGray">
<Image Name="ImageViewer" Stretch="None" />
</Canvas>
</Border>
</Grid>
</Window>