Compare commits

...

6 Commits
main ... lab-3

Author SHA1 Message Date
3b4f8bba61 lab-3 finished 2024-04-24 12:34:53 +04:00
2db8be3335 lab-3 in process 2024-04-24 12:05:30 +04:00
69969701cd lab-3 in process 2024-04-24 10:56:11 +04:00
c4ca0272fd lab-3 add forest image 2024-04-04 21:07:26 +04:00
ed503fa8ad lab-2 some minor fixes (image) 2024-04-04 21:02:53 +04:00
869854cf7d lab-2 2024-04-04 20:56:05 +04:00
8 changed files with 57 additions and 25 deletions

View File

@ -7,4 +7,19 @@
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<Resource Include="Resources\images\desert.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\images\forest.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\images\sea.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\images\sea2.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
</ItemGroup>
</Project>

View File

@ -5,7 +5,12 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Interfaces"
mc:Ignorable="d"
Title="Images" Height="450" Width="800">
Title="SoundBox" Height="450" Width="800">
<Window.Resources>
<SolidColorBrush x:Key="ForestBackgroundColor" Color="Olive" />
<SolidColorBrush x:Key="DesertBackgroundColor" Color="LightSalmon" />
<SolidColorBrush x:Key="SeaBackgroundColor" Color="DarkCyan" />
</Window.Resources>
<Grid ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
@ -14,25 +19,28 @@
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border Background="LemonChiffon" BorderThickness="4,4,4,4"
BorderBrush="Goldenrod">
<ScrollViewer CanContentScroll="True" VerticalScrollBarVisibility="Hidden">
<StackPanel Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center"
VerticalAlignment="Stretch" Orientation="Vertical">
<Button Margin="10,5,10,5" Padding="3,3,3,3">Image1</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Image2</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Image3</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Image4</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Image5</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Image6</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Image7</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Image8</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3" Click="ButtonForest_Click">Forest</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3" Click="ButtonDesert_Click">Desert</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3" Click="ButtonSea_Click">Sea</Button>
</StackPanel>
<DockPanel Grid.Row="0" Grid.Column="1">
</ScrollViewer>
</Border>
<DockPanel Name="PanelMenu" Grid.Row="0" Grid.Column="1"
Background="{StaticResource SeaBackgroundColor}">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Margin="10,5,10,5" Padding="3,3,3,3">Execute</Button>
<Button Margin="10,5,10,5" Padding="3,3,3,3">Cancel</Button>
</StackPanel>
<DockPanel Background="Black">
<Image Source="C:\Users\user\source\repos\Interfaces_Zakharov_Rostislav\Interfaces\images/image2.png"/>
<Viewbox>
<Image Name="ImageNature" Source="/Resources/images/sea.png"/>
</Viewbox>
</DockPanel>
</DockPanel>
</Grid>

View File

@ -1,17 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Interfaces
{
@ -24,5 +14,24 @@ namespace Interfaces
{
InitializeComponent();
}
private void ButtonDesert_Click(object sender, RoutedEventArgs e)
{
ImageNature.Source = new BitmapImage(new Uri("/Resources/images/desert.png", UriKind.Relative));
PanelMenu.Background = (Brush)TryFindResource("DesertBackgroundColor");
}
private void ButtonForest_Click(object sender, RoutedEventArgs e)
{
ImageNature.Source = new BitmapImage(new Uri("/Resources/images/forest.png", UriKind.Relative));
PanelMenu.Background = (Brush)TryFindResource("ForestBackgroundColor");
}
private void ButtonSea_Click(object sender, RoutedEventArgs e)
{
ImageNature.Source = new BitmapImage(new Uri("/Resources/images/sea.png", UriKind.Relative));
PanelMenu.Background = (Brush)TryFindResource("SeaBackgroundColor");
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 KiB

View File

Before

Width:  |  Height:  |  Size: 880 KiB

After

Width:  |  Height:  |  Size: 880 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.