95 lines
4.7 KiB
XML
95 lines
4.7 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="260" Height="340"
|
|
ResizeMode="NoResize"
|
|
WindowStartupLocation="CenterOwner"
|
|
Topmost="True"
|
|
ShowInTaskbar="False">
|
|
<Window.Resources>
|
|
<Style x:Key="ToolToggleStyle" TargetType="RadioButton">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="RadioButton">
|
|
<Border x:Name="Bd" Background="#EEEEEE" BorderBrush="#CCCCCC"
|
|
BorderThickness="1" CornerRadius="3" Padding="10,4" Cursor="Hand">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter TargetName="Bd" Property="Background" Value="#0078D7" />
|
|
<Setter TargetName="Bd" Property="BorderBrush" Value="#005A9E" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Bd" Property="Background" Value="#DDDDDD" />
|
|
</Trigger>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
<Condition Property="IsChecked" Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter TargetName="Bd" Property="Background" Value="#006CBE" />
|
|
</MultiTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</Window.Resources>
|
|
<StackPanel Margin="10">
|
|
<!-- 工具选择 -->
|
|
<TextBlock Text="工具" FontWeight="SemiBold" Margin="0,0,0,4" />
|
|
<WrapPanel>
|
|
<RadioButton x:Name="RbRoi" Content="ROI" IsChecked="True" Margin="0,0,4,4"
|
|
Style="{StaticResource ToolToggleStyle}" />
|
|
<RadioButton x:Name="RbWand" Content="魔棒" Margin="0,0,4,4"
|
|
Style="{StaticResource ToolToggleStyle}" />
|
|
<RadioButton x:Name="RbBrush" Content="画笔" Margin="0,0,4,4"
|
|
Style="{StaticResource ToolToggleStyle}" />
|
|
<RadioButton x:Name="RbEraser" Content="橡皮擦" Margin="0,0,0,4"
|
|
Style="{StaticResource ToolToggleStyle}" />
|
|
</WrapPanel>
|
|
|
|
<Separator Margin="0,6" />
|
|
|
|
<!-- 阈值 -->
|
|
<TextBlock Text="灰度阈值(与点击点的最大灰度差)" Margin="0,0,0,4" FontSize="11" Foreground="Gray" />
|
|
<DockPanel>
|
|
<TextBox x:Name="TbThreshold" DockPanel.Dock="Right" Width="45" Text="128"
|
|
VerticalContentAlignment="Center" Margin="6,0,0,0" />
|
|
<Slider x:Name="SliderThreshold" Minimum="0" Maximum="255" Value="128"
|
|
VerticalAlignment="Center" />
|
|
</DockPanel>
|
|
|
|
<!-- 画笔大小 -->
|
|
<TextBlock Text="画笔/橡皮大小" Margin="0,8,0,4" />
|
|
<DockPanel>
|
|
<TextBox x:Name="TbBrushSize" DockPanel.Dock="Right" Width="45" Text="5"
|
|
VerticalContentAlignment="Center" Margin="6,0,0,0" />
|
|
<Slider x:Name="SliderBrushSize" Minimum="1" Maximum="30" Value="5"
|
|
VerticalAlignment="Center" />
|
|
</DockPanel>
|
|
|
|
<Separator Margin="0,8" />
|
|
|
|
<!-- 结果 -->
|
|
<TextBlock Text="测量结果" FontWeight="SemiBold" Margin="0,0,0,4" />
|
|
<TextBlock x:Name="TbResult" Text="空隙率: --" FontSize="14" Margin="0,0,0,4" />
|
|
<DockPanel Margin="0,0,0,8">
|
|
<TextBlock Text="VoidLimit(%):" VerticalAlignment="Center" />
|
|
<TextBox x:Name="TbVoidLimit" Width="50" Text="25.0" Margin="6,0,0,0"
|
|
VerticalContentAlignment="Center" />
|
|
</DockPanel>
|
|
|
|
<!-- 操作按钮 -->
|
|
<WrapPanel HorizontalAlignment="Center">
|
|
<Button Content="撤销" Padding="12,4" Margin="0,0,8,0" Click="Undo_Click" />
|
|
<Button Content="清除标记" Padding="12,4" Margin="0,0,8,0" Click="ClearMask_Click" />
|
|
<Button Content="完成" Padding="12,4" Click="Finish_Click" />
|
|
</WrapPanel>
|
|
</StackPanel>
|
|
</Window>
|