Files
XplorePlane/XplorePlane/Views/ImageProcessing/BubbleMeasurePanel.xaml
T

119 lines
6.4 KiB
XML

<Window
x:Class="XplorePlane.Views.ImageProcessing.BubbleMeasurePanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="气泡测量工具"
Width="340" Height="380"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
Topmost="True" ShowInTaskbar="False"
Background="#F5F5F5" FontFamily="Microsoft YaHei UI">
<Window.Resources>
<Style x:Key="IconBtnStyle" TargetType="ButtonBase">
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Border x:Name="Bd" Background="#FFFFFF" BorderBrush="#E0E0E0"
BorderThickness="1" CornerRadius="6" Padding="8,6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#EAF2FB" />
<Setter TargetName="Bd" Property="BorderBrush" Value="#B0D4F1" />
</Trigger>
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#005FB8" />
<Setter TargetName="Bd" Property="BorderBrush" Value="#004C99" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CardStyle" TargetType="Border">
<Setter Property="Background" Value="White" />
<Setter Property="BorderBrush" Value="#E8E8E8" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="8" />
<Setter Property="Padding" Value="12,10" />
<Setter Property="Margin" Value="0,0,0,8" />
</Style>
<Style x:Key="ParamLabel" TargetType="TextBlock">
<Setter Property="FontSize" Value="11" />
<Setter Property="Foreground" Value="#555" />
<Setter Property="Margin" Value="0,0,0,3" />
</Style>
<Style TargetType="TextBox">
<Setter Property="BorderBrush" Value="#D0D0D0" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Padding" Value="4,3" />
<Setter Property="FontSize" Value="11.5" />
<Style.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="4" />
</Style>
</Style.Resources>
</Style>
</Window.Resources>
<StackPanel Margin="10">
<!-- 工具栏:工具选择 + 撤销/清除/完成 -->
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
<RadioButton x:Name="RbRoi" IsChecked="True" Style="{StaticResource IconBtnStyle}" ToolTip="ROI" Margin="0,0,4,0">
<Image Source="/Assets/Icons/rectangle32.png" Width="20" Height="20" />
</RadioButton>
<RadioButton x:Name="RbWand" Style="{StaticResource IconBtnStyle}" ToolTip="魔棒" Margin="0,0,4,0">
<Image Source="/Assets/Icons/magic32.png" Width="20" Height="20" />
</RadioButton>
<RadioButton x:Name="RbBrush" Style="{StaticResource IconBtnStyle}" ToolTip="画笔" Margin="0,0,4,0">
<Image Source="/Assets/Icons/brush32.png" Width="20" Height="20" />
</RadioButton>
<RadioButton x:Name="RbEraser" Style="{StaticResource IconBtnStyle}" ToolTip="橡皮擦" Margin="0,0,10,0">
<Image Source="/Assets/Icons/eraser32.png" Width="20" Height="20" />
</RadioButton>
<Button Style="{StaticResource IconBtnStyle}" ToolTip="撤销" Click="Undo_Click" Margin="0,0,4,0">
<Image Source="/Assets/Icons/Undo.png" Width="20" Height="20" />
</Button>
<Button Style="{StaticResource IconBtnStyle}" ToolTip="清除标记" Click="ClearMask_Click" Margin="0,0,4,0">
<Image Source="/Assets/Icons/Clear.png" Width="20" Height="20" />
</Button>
<Button Style="{StaticResource IconBtnStyle}" ToolTip="完成" Click="Finish_Click">
<Image Source="/Assets/Icons/ok.png" Width="20" Height="20" />
</Button>
</StackPanel>
<!-- 参数卡片 -->
<Border Style="{StaticResource CardStyle}">
<StackPanel>
<TextBlock Text="灰度阈值(与点击点的最大灰度差)" Style="{StaticResource ParamLabel}" />
<DockPanel Margin="0,0,0,8">
<TextBox x:Name="TbThreshold" DockPanel.Dock="Right" Width="50" Text="30"
VerticalContentAlignment="Center" Margin="6,0,0,0" />
<Slider x:Name="SliderThreshold" Minimum="0" Maximum="60" Value="30"
VerticalAlignment="Center" />
</DockPanel>
<TextBlock Text="画笔/橡皮大小" Style="{StaticResource ParamLabel}" />
<DockPanel>
<TextBox x:Name="TbBrushSize" DockPanel.Dock="Right" Width="50" Text="5"
VerticalContentAlignment="Center" Margin="6,0,0,0" />
<Slider x:Name="SliderBrushSize" Minimum="1" Maximum="30" Value="5"
VerticalAlignment="Center" />
</DockPanel>
</StackPanel>
</Border>
<!-- 结果卡片 -->
<Border Style="{StaticResource CardStyle}">
<StackPanel>
<TextBlock x:Name="TbResult" Text="空隙率: --" FontSize="13" FontWeight="SemiBold" Foreground="#333" Margin="0,0,0,6" />
<DockPanel>
<TextBlock Text="VoidLimit(%):" VerticalAlignment="Center" Style="{StaticResource ParamLabel}" />
<TextBox x:Name="TbVoidLimit" Width="50" Text="25.0" Margin="6,0,0,0"
VerticalContentAlignment="Center" />
</DockPanel>
</StackPanel>
</Border>
</StackPanel>
</Window>