Files
29WxOrder/WxOrder.Framework/Controls/ImageViewerWindow.xaml
T
2026-10-20 17:03:23 +08:00

80 lines
2.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<Window
x:Class="WxOrder.Framework.Controls.ImageViewerWindow"
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:local="clr-namespace:WxOrder.Framework.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="图片查看"
Width="900"
Height="650"
MinWidth="320"
MinHeight="240"
Background="#FF1E1E1E"
Focusable="True"
KeyDown="Window_KeyDown"
ShowInTaskbar="False"
mc:Ignorable="d">
<Grid
x:Name="Root"
Background="Transparent"
ClipToBounds="True"
LostMouseCapture="Root_LostMouseCapture"
MouseLeftButtonDown="Root_MouseLeftButtonDown"
MouseLeftButtonUp="Root_MouseLeftButtonUp"
MouseMove="Root_MouseMove"
MouseWheel="Root_MouseWheel"
SizeChanged="Root_SizeChanged">
<!-- Stretch=None:以图片原始尺寸显示,缩放/平移全部由 RenderTransform 完成 -->
<Image
x:Name="Img"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderTransformOrigin="0,0"
Stretch="None" />
<!-- 底部工具栏 -->
<Border
x:Name="ToolBar"
Margin="0,0,0,12"
Padding="6,4"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Background="#99000000"
CornerRadius="6">
<StackPanel Orientation="Horizontal">
<Button
Width="28"
Click="ZoomOut_Click"
Content="-"
ToolTip="缩小" />
<TextBlock
x:Name="ZoomText"
Width="52"
VerticalAlignment="Center"
Foreground="White"
Text="100%"
TextAlignment="Center" />
<Button
Width="28"
Click="ZoomIn_Click"
Content="+"
ToolTip="放大" />
<Button
Width="40"
Margin="6,0,0,0"
Click="Fit_Click"
Content="适应"
ToolTip="适应窗口" />
<Button
Width="36"
Margin="4,0,0,0"
Click="Actual_Click"
Content="1:1"
ToolTip="原始大小" />
</StackPanel>
</Border>
</Grid>
</Window>