AHAQ_QGNH/AnQing/View/ImageSetUp.xaml
2025-05-19 09:31:47 +08:00

35 lines
1.7 KiB
XML

<UserControl x:Class="AnQing.View.ImageSetUp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AnQing.View"
mc:Ignorable="d"
d:DesignHeight="780" d:DesignWidth="1100">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="150"></RowDefinition>
</Grid.RowDefinitions>
<!-- 图片显示区域 -->
<Image x:Name="MainImage" Stretch="Uniform" VerticalAlignment="Center" Height="560"/>
<!-- 画布用于框选 -->
<Canvas x:Name="SelectionCanvas" Background="Transparent" Height="560">
<Rectangle x:Name="SelectionRectangle" Stroke="Red" StrokeThickness="2" Fill="#66FF0000" Visibility="Collapsed"/>
</Canvas>
<!-- 按钮 -->
<StackPanel HorizontalAlignment="Center" Grid.Row="1" VerticalAlignment="Bottom" Margin="0,20,0,0" >
<!-- 显示选区信息 -->
<TextBlock x:Name="InfoText" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,20,0,0"/>
<WrapPanel Margin="0,0,0,20">
<Button Content="选择图片" Click="SelectImage_Click" Margin="5"/>
<Button Content="获取选区数据" Click="GetSelectionData_Click" Margin="5"/>
<Button Content="保存数值并返回" Click="Button_Click" Margin="5"/>
</WrapPanel>
</StackPanel>
</Grid>
</UserControl>