Files
community/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml
T

244 lines
10 KiB
XML
Raw Normal View History

2025-07-30 20:06:29 +08:00
<Window x:Class="Ink_Canvas.ScreenshotSelectorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="选择截图区域"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
WindowState="Maximized"
Topmost="True"
ShowInTaskbar="False"
Cursor="Cross"
KeyDown="Window_KeyDown"
MouseLeftButtonDown="Window_MouseLeftButtonDown"
MouseMove="Window_MouseMove"
MouseLeftButtonUp="Window_MouseLeftButtonUp">
<Grid Name="MainGrid">
<!-- 半透明遮罩 -->
<Rectangle Name="OverlayRectangle"
Fill="Black"
2025-08-31 12:16:29 +08:00
Opacity="0.3" />
2025-08-31 09:54:13 +08:00
<Rectangle Name="TransparentSelectionMask"
Fill="Black"
Opacity="0.3"
Visibility="Collapsed">
<Rectangle.Clip>
<CombinedGeometry GeometryCombineMode="Exclude">
<CombinedGeometry.Geometry1>
<RectangleGeometry Rect="0,0,10000,10000" />
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
<RectangleGeometry x:Name="SelectionClipGeometry" Rect="0,0,0,0" />
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</Rectangle.Clip>
</Rectangle>
2025-07-30 20:06:29 +08:00
<!-- 选择区域容器 -->
2025-08-31 09:54:13 +08:00
<Canvas Name="SelectionCanvas" Panel.ZIndex="1000">
2025-07-31 10:27:19 +08:00
<!-- 矩形选择模式 -->
2025-07-30 20:06:29 +08:00
<Rectangle Name="SelectionRectangle"
2025-08-31 09:54:13 +08:00
Stroke="White"
StrokeThickness="1"
2025-08-31 12:16:29 +08:00
Fill="#01000000"
2025-08-31 10:47:33 +08:00
Visibility="Collapsed"
Panel.ZIndex="1001"
MouseLeftButtonDown="SelectionRectangle_MouseLeftButtonDown"
MouseLeftButtonUp="SelectionRectangle_MouseLeftButtonUp"
MouseMove="SelectionRectangle_MouseMove"
Cursor="SizeAll" />
2025-07-30 20:06:29 +08:00
2025-07-31 10:27:19 +08:00
<!-- 任意形状选择模式 -->
<Path Name="SelectionPath"
2025-08-31 09:54:13 +08:00
Stroke="White"
StrokeThickness="1"
2025-07-31 10:27:19 +08:00
Fill="Transparent"
Visibility="Collapsed" />
2025-08-31 09:54:13 +08:00
<!-- 控制点容器 -->
<Canvas Name="ControlPointsCanvas" Visibility="Collapsed" Panel.ZIndex="1002">
<!-- 四个角控制点 -->
<Ellipse Name="TopLeftControl" Width="8" Height="8" Fill="White" Stroke="White" StrokeThickness="1" Cursor="SizeNWSE" />
<Ellipse Name="TopRightControl" Width="8" Height="8" Fill="White" Stroke="White" StrokeThickness="1" Cursor="SizeNESW" />
<Ellipse Name="BottomLeftControl" Width="8" Height="8" Fill="White" Stroke="White" StrokeThickness="1" Cursor="SizeNESW" />
<Ellipse Name="BottomRightControl" Width="8" Height="8" Fill="White" Stroke="White" StrokeThickness="1" Cursor="SizeNWSE" />
<!-- 四个边控制点 -->
<Ellipse Name="TopControl" Width="8" Height="8" Fill="White" Stroke="White" StrokeThickness="1" Cursor="SizeNS" />
<Ellipse Name="BottomControl" Width="8" Height="8" Fill="White" Stroke="White" StrokeThickness="1" Cursor="SizeNS" />
<Ellipse Name="LeftControl" Width="8" Height="8" Fill="White" Stroke="White" StrokeThickness="1" Cursor="SizeWE" />
<Ellipse Name="RightControl" Width="8" Height="8" Fill="White" Stroke="White" StrokeThickness="1" Cursor="SizeWE" />
</Canvas>
2025-07-30 20:06:29 +08:00
<!-- 尺寸信息显示 -->
<Border Name="SizeInfoBorder"
2025-08-31 09:54:13 +08:00
Background="#1a1a1a"
Opacity="0.9"
CornerRadius="4"
2025-07-30 20:06:29 +08:00
Padding="8,4"
Visibility="Collapsed">
<TextBlock Name="SizeInfoText"
Foreground="White"
FontSize="12"
2025-08-31 09:54:13 +08:00
FontWeight="Medium"
2025-07-30 20:06:29 +08:00
Text="0 x 0" />
</Border>
</Canvas>
2025-08-31 12:32:15 +08:00
<!-- 底部工具栏 -->
2025-08-31 09:54:13 +08:00
<Border Background="#1a1a1a"
Opacity="0.95"
CornerRadius="8"
Padding="12,8"
HorizontalAlignment="Center"
2025-08-31 12:32:15 +08:00
VerticalAlignment="Bottom"
Margin="0,0,0,80"
2025-08-31 09:54:13 +08:00
Panel.ZIndex="1000">
<StackPanel Orientation="Horizontal">
<!-- 模式切换按钮 -->
<Button Name="RectangleModeButton"
Content="矩形模式"
Margin="4,0"
Padding="12,6"
2025-09-13 13:50:41 +08:00
Background="#6b7280"
2025-08-31 09:54:13 +08:00
Foreground="White"
BorderThickness="0"
FontWeight="Medium"
Click="RectangleModeButton_Click" />
<Button Name="FreehandModeButton"
Content="自由绘制"
Margin="4,0"
Padding="12,6"
Background="#6b7280"
Foreground="White"
BorderThickness="0"
FontWeight="Medium"
Click="FreehandModeButton_Click" />
2025-09-13 13:37:51 +08:00
<Button Name="FullScreenButton"
Content="全屏截图"
Margin="4,0"
Padding="12,6"
2025-09-13 13:50:41 +08:00
Background="#6b7280"
2025-09-13 13:37:51 +08:00
Foreground="White"
BorderThickness="0"
FontWeight="Medium"
Click="FullScreenButton_Click" />
2025-09-13 13:59:54 +08:00
<Button Name="CameraModeButton"
Content="摄像头截图"
Margin="4,0"
Padding="12,6"
Background="#6b7280"
Foreground="White"
BorderThickness="0"
FontWeight="Medium"
Click="CameraModeButton_Click" />
2025-08-31 09:54:13 +08:00
<!-- 分隔线 -->
<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"
Margin="8,0"
Background="#404040" />
<!-- 操作按钮 -->
<Button Name="ConfirmButton"
Content="确认截图"
Margin="4,0"
Padding="12,6"
Background="#059669"
Foreground="White"
BorderThickness="0"
FontWeight="Medium"
Click="ConfirmButton_Click" />
<Button Name="CancelButton"
Content="取消"
Margin="4,0"
Padding="12,6"
Background="#dc2626"
Foreground="White"
BorderThickness="0"
FontWeight="Medium"
Click="CancelButton_Click" />
</StackPanel>
</Border>
2025-07-31 10:27:19 +08:00
2025-09-13 13:59:54 +08:00
<!-- 摄像头预览区域 -->
<Border Name="CameraPreviewBorder"
Background="#1a1a1a"
Opacity="0.95"
CornerRadius="8"
Padding="8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="640"
Height="480"
Visibility="Collapsed"
Panel.ZIndex="1000">
<Grid>
<!-- 摄像头预览画面 -->
<Image Name="CameraPreviewImage"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<!-- 摄像头控制面板 -->
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Margin="0,0,0,8">
<!-- 摄像头选择下拉框 -->
<ComboBox Name="CameraSelectionComboBox"
Width="200"
Margin="4,0"
Background="#2d2d2d"
Foreground="White"
BorderBrush="#404040"
SelectionChanged="CameraSelectionComboBox_SelectionChanged" />
<!-- 切换摄像头按钮 -->
<Button Name="SwitchCameraButton"
Content="切换摄像头"
Margin="4,0"
Padding="8,4"
Background="#3b82f6"
Foreground="White"
BorderThickness="0"
FontWeight="Medium"
Click="SwitchCameraButton_Click" />
</StackPanel>
<!-- 摄像头状态指示 -->
<Border Background="#1a1a1a"
Opacity="0.9"
CornerRadius="4"
Padding="8,4"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="8">
<TextBlock Name="CameraStatusText"
Foreground="White"
FontSize="12"
FontWeight="Medium"
Text="摄像头未连接" />
</Border>
</Grid>
</Border>
2025-09-13 13:50:41 +08:00
<!-- 统一提示文字区域 -->
<Border Name="HintTextBorder"
2025-08-31 09:54:13 +08:00
Background="#1a1a1a"
Opacity="0.9"
CornerRadius="6"
Padding="16,10"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
2025-08-31 12:32:15 +08:00
Margin="0,0,0,140"
2025-08-31 09:54:13 +08:00
Panel.ZIndex="1000">
2025-09-13 13:50:41 +08:00
<TextBlock Name="HintText"
Text="拖拽鼠标选择矩形区域,或使用自由绘制模式"
2025-08-31 09:54:13 +08:00
Foreground="White"
FontSize="14"
FontWeight="Medium" />
2025-07-30 20:06:29 +08:00
</Border>
</Grid>
</Window>