schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<UserControl x:Class="XHandler.View.BacteriaPickResult.ImagePreview"
             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:XHandler.View.BacteriaPickResult"
             xmlns:str="clr-namespace:XHandler.Properties"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             Style="{StaticResource UCStyle}"
             Loaded="UserControl_Loaded">
    
    <Grid Margin="80,40">
        <Border x:Name="border" Background="White" CornerRadius="6" ClipToBounds="True">
            <Grid >
                <ScrollViewer x:Name="Sv" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden">
                    <Viewbox x:Name="viewBox" MouseWheel="Box_OnMouseWheel" PreviewMouseLeftButtonDown="Box_OnPreviewMouseLeftButtonDown"
                              PreviewMouseLeftButtonUp="Box_OnPreviewMouseLeftButtonUp" PreviewMouseMove="Box_OnPreviewMouseMove" Stretch="Uniform">
                        <Viewbox.RenderTransform>
                            <MatrixTransform>
                                <MatrixTransform.Matrix>
                                    <Matrix OffsetX="0" OffsetY="0" />
                                </MatrixTransform.Matrix>
                            </MatrixTransform>
                        </Viewbox.RenderTransform>
                        <Grid>
                            <Image x:Name="Img"></Image>
                        </Grid>
                    </Viewbox>
                </ScrollViewer>
 
                <Button Content="×" HorizontalAlignment="Right" VerticalAlignment="Top" VerticalContentAlignment="Center" Margin="5 5" FontSize="28" Width="40" Height="40"
                            FontWeight="Bold" Foreground="Black" Style="{DynamicResource BlueButtonStyle}" Background="White" Click="Button_Click"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>