You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
226 lines
12 KiB
226 lines
12 KiB
<UserControl x:Class="ECMonitor.Page.CameraMonitor.CameraAdjust"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="450" d:DesignWidth="300">
|
|
|
|
<UserControl.Resources>
|
|
<SolidColorBrush x:Key="Background" Color="#40444d" />
|
|
<SolidColorBrush x:Key="BackgroundInterval" Color="#292D36" />
|
|
<SolidColorBrush x:Key="ButtonNormal" Color="AntiqueWhite" />
|
|
<SolidColorBrush x:Key="ButtonLight" Color="DeepSkyBlue" />
|
|
<SolidColorBrush x:Key="ButtonMouseOver" Color="DeepSkyBlue" />
|
|
<SolidColorBrush x:Key="ButtonMousePress" Color="Aqua" />
|
|
|
|
<ControlTemplate x:Key="ArrowButtonTemplate" TargetType="{x:Type Button}">
|
|
<Polygon x:Name="ButtonPolygon" Stretch="Fill" Points="0,0 200,0 100,-100" Stroke="Black" StrokeThickness="0">
|
|
<Polygon.Fill>
|
|
<SolidColorBrush Color="AntiqueWhite" Opacity="0.8" />
|
|
</Polygon.Fill>
|
|
</Polygon>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="ButtonPolygon" Property="Fill" Value="{StaticResource ButtonMouseOver}" />
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter TargetName="ButtonPolygon" Property="Fill" Value="{StaticResource ButtonMousePress}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
<Style x:Key="ArrowButtonStyle" TargetType="Button">
|
|
<Setter Property="Width" Value="18" />
|
|
<Setter Property="Height" Value="9" />
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
</Style>
|
|
|
|
<ControlTemplate x:Key="ResetButtonTemplate" TargetType="{x:Type Button}">
|
|
<Grid>
|
|
<Ellipse x:Name="Ellipse" Stroke="{StaticResource ButtonLight}" StrokeThickness="2" Fill="{StaticResource Background}" />
|
|
<Path x:Name="Icon" Width="20" Height="20" Fill="AntiqueWhite" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Data="F1 M 24,13C 27.1521,13 29.9945,14.3258 32,16.4501L 32,11L 35,14L 35,22L 27,22L 24,19L 29.5903,19C 28.217,17.4656 26.2212,16.5 24,16.5C 20.1969,16.5 17.055,19.3306 16.5661,23L 13.0448,23C 13.5501,17.3935 18.262,13 24,13 Z M 24,31.5C 27.8031,31.5 30.945,28.6694 31.4339,25L 34.9552,25C 34.4499,30.6065 29.738,35 24,35C 20.8479,35 18.0055,33.6742 16,31.5499L 16,37L 13,34L 13,26L 21,26L 24,29L 18.4097,29C 19.783,30.5344 21.7787,31.5 24,31.5 Z" />
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource BackgroundInterval}" />
|
|
<Setter TargetName="Icon" Property="Fill" Value="{StaticResource ButtonMouseOver}" />
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource BackgroundInterval}" />
|
|
<Setter TargetName="Icon" Property="Fill" Value="{StaticResource ButtonMousePress}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
<Style x:Key="ResetButtonStyle" TargetType="Button">
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
</Style>
|
|
|
|
<ControlTemplate x:Key="PlusButtonTemplate" TargetType="{x:Type Button}">
|
|
<!--<Grid Margin="5" Cursor="Hand">
|
|
<Ellipse x:Name="Ellipse" Stroke="{StaticResource BackgroundInterval}" StrokeThickness="2" Fill="{StaticResource Background}" />
|
|
<materialDesign:PackIcon Kind="Plus" Foreground="AliceBlue" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Grid>-->
|
|
<Border x:Name="Border" CornerRadius="100" Background="{StaticResource Background}" BorderBrush="{StaticResource BackgroundInterval}" BorderThickness="2">
|
|
<materialDesign:PackIcon Kind="Plus" Foreground="{StaticResource ButtonNormal}" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="{StaticResource ButtonMouseOver}" />
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="Transparent" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
|
|
<ControlTemplate x:Key="MinusButtonTemplate" TargetType="{x:Type Button}">
|
|
<Border x:Name="Border" CornerRadius="100" Background="{StaticResource Background}" BorderBrush="{StaticResource BackgroundInterval}" BorderThickness="2">
|
|
<materialDesign:PackIcon Kind="Minus" Foreground="{StaticResource ButtonNormal}" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="{StaticResource ButtonMouseOver}" />
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="Transparent" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
<Style x:Key="PressButtonStyle" TargetType="Button">
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
<Setter Property="Margin" Value="7" />
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
</Style>
|
|
</UserControl.Resources>
|
|
|
|
<StackPanel>
|
|
<Border CornerRadius="100" Background="{StaticResource Background}" BorderBrush="{StaticResource BackgroundInterval}" BorderThickness="10" Height="175" Width="175" Margin="0,20,0,0">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="1*" />
|
|
<RowDefinition Height="1*" />
|
|
<RowDefinition Height="1*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="1*" />
|
|
<ColumnDefinition Width="1*" />
|
|
<ColumnDefinition Width="1*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button x:Name="luBtn" Grid.Row="0" Grid.Column="0" Template="{StaticResource ArrowButtonTemplate}"
|
|
Style="{StaticResource ArrowButtonStyle}" HorizontalAlignment="Right" VerticalAlignment="Bottom" RenderTransformOrigin="0.0,0.5">
|
|
<Button.RenderTransform>
|
|
<RotateTransform Angle="-45" />
|
|
</Button.RenderTransform>
|
|
</Button>
|
|
<Button x:Name="uBtn" Grid.Row="0" Grid.Column="1" Template="{StaticResource ArrowButtonTemplate}"
|
|
Style="{StaticResource ArrowButtonStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
|
<Button.RenderTransform>
|
|
<RotateTransform Angle="0" />
|
|
</Button.RenderTransform>
|
|
</Button>
|
|
<Button x:Name="ruBtn" Grid.Row="0" Grid.Column="2" Template="{StaticResource ArrowButtonTemplate}"
|
|
Style="{StaticResource ArrowButtonStyle}" HorizontalAlignment="Left" VerticalAlignment="Bottom" RenderTransformOrigin="0.9,0.45">
|
|
<Button.RenderTransform>
|
|
<RotateTransform Angle="45" />
|
|
</Button.RenderTransform>
|
|
</Button>
|
|
|
|
<Button x:Name="lBtn" Grid.Row="1" Grid.Column="0" Template="{StaticResource ArrowButtonTemplate}"
|
|
Style="{StaticResource ArrowButtonStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
|
<Button.RenderTransform>
|
|
<RotateTransform Angle="-90" />
|
|
</Button.RenderTransform>
|
|
</Button>
|
|
<Border x:Name="cBtn" Grid.Row="1" Grid.Column="1" CornerRadius="100" BorderBrush="{StaticResource BackgroundInterval}" BorderThickness="5">
|
|
<Button Template="{StaticResource ResetButtonTemplate}"
|
|
Style="{StaticResource ResetButtonStyle}">
|
|
</Button>
|
|
</Border>
|
|
<Button x:Name="rBtn" Grid.Row="1" Grid.Column="2" Template="{StaticResource ArrowButtonTemplate}"
|
|
Style="{StaticResource ArrowButtonStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
|
<Button.RenderTransform>
|
|
<RotateTransform Angle="90" />
|
|
</Button.RenderTransform>
|
|
</Button>
|
|
|
|
<Button x:Name="ldBtn" Grid.Row="2" Grid.Column="0" Template="{StaticResource ArrowButtonTemplate}"
|
|
Style="{StaticResource ArrowButtonStyle}" HorizontalAlignment="Right" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.9">
|
|
<Button.RenderTransform>
|
|
<RotateTransform Angle="-135" />
|
|
</Button.RenderTransform>
|
|
</Button>
|
|
<Button x:Name="dBtn" Grid.Row="2" Grid.Column="1" Template="{StaticResource ArrowButtonTemplate}"
|
|
Style="{StaticResource ArrowButtonStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
|
<Button.RenderTransform>
|
|
<RotateTransform Angle="180" />
|
|
</Button.RenderTransform>
|
|
</Button>
|
|
<Button x:Name="rdBtn" Grid.Row="2" Grid.Column="2" Template="{StaticResource ArrowButtonTemplate}"
|
|
Style="{StaticResource ArrowButtonStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="0.45,0.9">
|
|
<Button.RenderTransform>
|
|
<RotateTransform Angle="135" />
|
|
</Button.RenderTransform>
|
|
</Button>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Border Height="175" Width="175" Margin="0,10,0,0">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="1*" />
|
|
<RowDefinition Height="1*" />
|
|
<RowDefinition Height="1*" />
|
|
<RowDefinition Height="1*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="1*" />
|
|
<ColumnDefinition Width="1*" />
|
|
<ColumnDefinition Width="1*" />
|
|
<ColumnDefinition Width="1*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Style="{StaticResource MaterialDesignCaptionTextBlock}" Foreground="{StaticResource ButtonNormal}" Text="变倍" />
|
|
<Button Grid.Row="0" Grid.Column="1" Template="{StaticResource PlusButtonTemplate}"
|
|
Style="{StaticResource PressButtonStyle}">
|
|
</Button>
|
|
<Button Grid.Row="0" Grid.Column="3" Template="{StaticResource MinusButtonTemplate}"
|
|
Style="{StaticResource PressButtonStyle}">
|
|
</Button>
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Style="{StaticResource MaterialDesignCaptionTextBlock}" Foreground="{StaticResource ButtonNormal}" Text="变焦" />
|
|
<Button Grid.Row="1" Grid.Column="1" Template="{StaticResource PlusButtonTemplate}"
|
|
Style="{StaticResource PressButtonStyle}">
|
|
</Button>
|
|
<Button Grid.Row="1" Grid.Column="3" Template="{StaticResource MinusButtonTemplate}"
|
|
Style="{StaticResource PressButtonStyle}">
|
|
</Button>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Style="{StaticResource MaterialDesignCaptionTextBlock}" Foreground="{StaticResource ButtonNormal}" Text="光圈" />
|
|
<Button Grid.Row="2" Grid.Column="1" Template="{StaticResource PlusButtonTemplate}"
|
|
Style="{StaticResource PressButtonStyle}">
|
|
</Button>
|
|
<Button Grid.Row="2" Grid.Column="3" Template="{StaticResource MinusButtonTemplate}"
|
|
Style="{StaticResource PressButtonStyle}">
|
|
</Button>
|
|
|
|
<TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Style="{StaticResource MaterialDesignCaptionTextBlock}" Foreground="{StaticResource ButtonNormal}" Text="步长" />
|
|
|
|
<Slider x:Name="stepSlider" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="7,0,7,0"
|
|
Minimum="1" Maximum="10" Value="6" TickFrequency="1" materialDesign:SliderAssist.OnlyShowFocusVisualWhileDragging="True"
|
|
Style="{StaticResource MaterialDesignDiscreteSlider}" Cursor="Hand" />
|
|
</Grid>
|
|
</Border>
|
|
</StackPanel>
|
|
</UserControl>
|