12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <Window x:Class="ConstRectCropImage.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:ConstRectCropImage"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="40"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Grid Grid.Row="0" Grid.Column="0" x:Name="GridOrigImg" SizeChanged="Canvas_SizeChanged">
- <Canvas x:Name="MyCanvas"
- MouseLeftButtonDown="Canvas_MouseLeftBtnDown"
- MouseMove="Canvas_MouseMove">
- <Image x:Name="OrigImage" Stretch="Fill">
- <Image.RenderTransform>
- <ScaleTransform x:Name="OrigImgScaleTramsform"/>
- </Image.RenderTransform>
- </Image>
- </Canvas>
- </Grid>
- <Grid Grid.Row="1" Grid.Column="0">
- <StackPanel Orientation="Horizontal">
- <Button Content="加载多幅图像" FontSize="12" Margin="4,4,4,4" Width="100" Click="OnLoadMultiImagesClick"/>
- <TextBlock Text="鼠标位置:" FontSize="12" Margin="4,4,4,4" VerticalAlignment="Center" Width="60"/>
- <TextBlock x:Name="MousePosition" FontSize="12" Margin="4,4,4,4" VerticalAlignment="Center" Width="50"/>
- <TextBlock Text="ROI:" FontSize="12" Margin="4,4,4,4" VerticalAlignment="Center" Width="30"/>
- <TextBlock x:Name="ROI" FontSize="12" Margin="4,4,4,4" VerticalAlignment="Center" Width="100"/>
- <Button Content="使用当前ROI" FontSize="12" Margin="4,4,4,4" Width="120" Click="UseCurrentRoiClick"/>
- <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
- <RadioButton x:Name="RadioBtnResultCropRect" Content="在原图上显示裁切框" Margin="4,4,4,2" IsChecked="True"/>
- <RadioButton x:Name="RadioBtnResultCropped" Content="只保留裁切后的图片" Margin="4,2,4,4"/>
- </StackPanel>
- <Button Content="保存" FontSize="12" Margin="4,4,4,4" Width="60" Click="SaveCropDatasClick"/>
- </StackPanel>
- </Grid>
- </Grid>
- </Window>
|