<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"
                   Opacity="0.3" />

        <!-- 选择区域容器 -->
        <Canvas Name="SelectionCanvas">
            <!-- 矩形选择模式 -->
            <Rectangle Name="SelectionRectangle"
                       Stroke="Red"
                       StrokeThickness="2"
                       Fill="Transparent"
                       Visibility="Collapsed" />

            <!-- 任意形状选择模式 -->
            <Path Name="SelectionPath"
                  Stroke="Red"
                  StrokeThickness="2"
                  Fill="Transparent"
                  Visibility="Collapsed" />

            <!-- 尺寸信息显示 -->
            <Border Name="SizeInfoBorder"
                    Background="Black"
                    Opacity="0.8"
                    CornerRadius="3"
                    Padding="8,4"
                    Visibility="Collapsed">
                <TextBlock Name="SizeInfoText"
                           Foreground="White"
                           FontSize="12"
                           Text="0 x 0" />
            </Border>
        </Canvas>

        <!-- 模式切换按钮 -->
        <StackPanel Orientation="Horizontal" 
                    HorizontalAlignment="Center" 
                    VerticalAlignment="Top" 
                    Margin="0,100,0,0">
            <Button Name="RectangleModeButton" 
                    Content="矩形模式" 
                    Margin="5,0" 
                    Padding="10,5"
                    Background="#2563eb"
                    Foreground="White"
                    BorderThickness="0"
                    Click="RectangleModeButton_Click" />
            <Button Name="FreehandModeButton" 
                    Content="自由绘制" 
                    Margin="5,0" 
                    Padding="10,5"
                    Background="#6b7280"
                    Foreground="White"
                    BorderThickness="0"
                    Click="FreehandModeButton_Click" />
        </StackPanel>

        <!-- 提示文字 -->
        <Border Background="Black"
                Opacity="0.8"
                CornerRadius="5"
                Padding="15,8"
                HorizontalAlignment="Center"
                VerticalAlignment="Top"
                Margin="0,150,0,0">
            <TextBlock Name="HintText"
                       Text="拖拽鼠标选择矩形区域，或使用自由绘制模式"
                       Foreground="White"
                       FontSize="16" />
        </Border>
    </Grid>
</Window>
