+198
-106
@@ -3159,33 +3159,94 @@
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top" Margin="800,900,0,0"
|
||||
CornerRadius="5" Height="80"
|
||||
Background="{DynamicResource FloatBarBackground}"
|
||||
Visibility="Collapsed"
|
||||
Visibility="{Binding ElementName=GridInkCanvasSelectionCover, Path=Visibility}"
|
||||
BorderThickness="1" BorderBrush="{DynamicResource FloatBarBorderBrush}">
|
||||
<Viewbox Margin="0,-2.5">
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="10" Height="60">
|
||||
<Border Name="BorderImageRotateLeft" Margin="0,2,-9,2" Background="Transparent"
|
||||
<Border Name="BorderImageClone" Margin="0,2,-9,2" Background="Transparent"
|
||||
CornerRadius="{Binding ElementName=BorderImageSelectionControl, Path=CornerRadius}"
|
||||
Width="40" MouseDown="Border_MouseDown" MouseUp="BorderImageRotateLeft_MouseUp">
|
||||
Width="40" MouseDown="Border_MouseDown" MouseUp="BorderImageClone_MouseUp">
|
||||
<ui:SimpleStackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<Image Source="/Resources/Icons-Fluent/ic_fluent_flip_horizontal_24_regular.png"
|
||||
<Image Source="/Resources/Icons-Fluent/ic_fluent_copy_24_regular.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="25" Width="25" />
|
||||
<TextBlock Text="左转" FontSize="10" Foreground="{DynamicResource FloatBarForeground}"
|
||||
<TextBlock Text="克隆" FontSize="10" Foreground="{DynamicResource FloatBarForeground}"
|
||||
HorizontalAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<Border Name="BorderImageRotateRight" Margin="0,2,-9,2" Background="Transparent"
|
||||
<Border Name="BorderImageCloneToNewBoard"
|
||||
Margin="0,2,-9,2"
|
||||
Background="Transparent"
|
||||
CornerRadius="{Binding ElementName=BorderImageSelectionControl, Path=CornerRadius}"
|
||||
Width="40" MouseDown="Border_MouseDown" MouseUp="BorderImageRotateRight_MouseUp">
|
||||
<ui:SimpleStackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<Image Source="/Resources/Icons-Fluent/ic_fluent_flip_vertical_24_regular.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="25" Width="25" />
|
||||
<TextBlock Text="右转" FontSize="10" Foreground="{DynamicResource FloatBarForeground}"
|
||||
Width="40"
|
||||
MouseDown="Border_MouseDown"
|
||||
MouseUp="BorderImageCloneToNewBoard_MouseUp"
|
||||
Visibility="{Binding Visibility, ElementName=GridBackgroundCover}">
|
||||
<ui:SimpleStackPanel VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center">
|
||||
<Image Source="/Resources/Icons-Fluent/ic_fluent_copy_add_24_regular.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Height="25"
|
||||
Width="25" />
|
||||
<TextBlock Text="克隆至新页"
|
||||
FontSize="8"
|
||||
Foreground="{DynamicResource FloatBarForeground}"
|
||||
HorizontalAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<Border Width="1"
|
||||
Height="45"
|
||||
BorderBrush="{DynamicResource FloatBarForeground}"
|
||||
Background="{DynamicResource FloatBarForeground}" />
|
||||
<Border CornerRadius="{Binding ElementName=BorderImageSelectionControl, Path=CornerRadius}"
|
||||
Height="40">
|
||||
<ui:SimpleStackPanel VerticalAlignment="Center"
|
||||
Spacing="5"
|
||||
Margin="0,-10">
|
||||
<ui:SimpleStackPanel Orientation="Horizontal"
|
||||
Spacing="10">
|
||||
<Image Source="{DynamicResource Rotate45DrawingImage}"
|
||||
Height="22"
|
||||
MouseDown="Border_MouseDown"
|
||||
MouseUp="BorderImageRotateLeft_MouseUp" />
|
||||
<Image Source="{DynamicResource Rotate90DrawingImage}"
|
||||
Height="22"
|
||||
MouseDown="Border_MouseDown"
|
||||
MouseUp="BorderImageRotateRight_MouseUp" />
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Text="旋转"
|
||||
FontSize="10"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="{DynamicResource FloatBarForeground}" />
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<Border Width="1" Height="45" BorderBrush="{DynamicResource FloatBarForeground}"
|
||||
Background="{DynamicResource FloatBarForeground}" />
|
||||
<Border Name="BorderImageDelete" Margin="-8,0,0,0"
|
||||
<Border CornerRadius="{Binding ElementName=BorderImageSelectionControl, Path=CornerRadius}"
|
||||
Height="40">
|
||||
<ui:SimpleStackPanel VerticalAlignment="Center" Spacing="5" Margin="0,-10">
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="10">
|
||||
<Grid MouseDown="Border_MouseDown" MouseUp="GridImageScaleDecrease_MouseUp">
|
||||
<Image Source="/Resources/Icons-Fluent/ic_fluent_scale_fit_24_regular.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="25" Width="25" />
|
||||
<TextBlock Text="-" Foreground="{DynamicResource FloatBarForeground}"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Right"
|
||||
Margin="0,0,-2,-7" FontSize="15" />
|
||||
</Grid>
|
||||
<Grid MouseDown="Border_MouseDown" MouseUp="GridImageScaleIncrease_MouseUp">
|
||||
<Image Source="/Resources/Icons-Fluent/ic_fluent_scale_fit_24_regular.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="25" Width="25" />
|
||||
<TextBlock Text="+" Foreground="{DynamicResource FloatBarForeground}"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Right"
|
||||
Margin="0,0,-3,-4" FontSize="11" />
|
||||
</Grid>
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Text="缩放" FontSize="10" HorizontalAlignment="Center"
|
||||
Foreground="{DynamicResource FloatBarForeground}" />
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<Border Width="1" Height="45" BorderBrush="{DynamicResource FloatBarForeground}"
|
||||
Background="{DynamicResource FloatBarForeground}" />
|
||||
<Border Margin="-8,0,0,0"
|
||||
CornerRadius="{Binding ElementName=BorderImageSelectionControl, Path=CornerRadius}"
|
||||
Width="40" MouseDown="Border_MouseDown" MouseUp="BorderImageDelete_MouseUp">
|
||||
<ui:SimpleStackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
@@ -3442,6 +3503,12 @@
|
||||
Padding="0,7"
|
||||
FontSize="17" FontWeight="Bold"
|
||||
TextAlignment="Center" />
|
||||
<Image Margin="144,10,0,0"
|
||||
Source="/Resources/new-icons/close-white.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Height="16"
|
||||
Width="16" MouseDown="Border_MouseDown"
|
||||
MouseUp="CloseBordertools_MouseUp" />
|
||||
</Canvas>
|
||||
</Border>
|
||||
<Viewbox Margin="8,0,8,0">
|
||||
@@ -4564,6 +4631,12 @@
|
||||
Padding="0,5"
|
||||
FontSize="11" FontWeight="Bold"
|
||||
TextAlignment="Center" />
|
||||
<Image Margin="100,4,0,0"
|
||||
Source="/Resources/new-icons/close-white.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Height="16"
|
||||
Width="16" MouseDown="Border_MouseDown"
|
||||
MouseUp="CloseBordertools_MouseUp" />
|
||||
</Canvas>
|
||||
</Border>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Margin="0,6,0,0"
|
||||
@@ -4920,10 +4993,8 @@
|
||||
</Border>
|
||||
</Border>
|
||||
<Border x:Name="BoardInsertImage" Width="60" Height="50" MouseDown="Border_MouseDown"
|
||||
MouseUp="InsertImageOptions_MouseUp" BorderThickness="0,1,0,1"
|
||||
BorderBrush="#a1a1aa"
|
||||
Background="#f4f4f5"
|
||||
Opacity="0.95">
|
||||
BorderThickness="0,1,0,1" BorderBrush="#a1a1aa"
|
||||
MouseUp="InsertImageOptions_MouseUp" Background="#f4f4f5" Opacity="0.95">
|
||||
<Grid Margin="6,6,6,4">
|
||||
<Image VerticalAlignment="Top"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20">
|
||||
@@ -4942,6 +5013,96 @@
|
||||
HorizontalAlignment="Center" FontSize="12" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
|
||||
<!-- Image Insertion Options Panel -->
|
||||
<Border ClipToBounds="True" Name="BoardImageOptionsPanel" Visibility="Collapsed"
|
||||
Margin="-80,-90,-14,33.5"
|
||||
CornerRadius="5" Background="#fafafa" Opacity="1"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#2563eb">
|
||||
<ui:SimpleStackPanel Margin="0">
|
||||
<Border BorderBrush="#1e3a8a" BorderThickness="0,0,0,1"
|
||||
CornerRadius="5,5,0,0" Background="#2563eb"
|
||||
Padding="8,4">
|
||||
<ui:SimpleStackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextBlock Text="选择图片" Foreground="White"
|
||||
FontSize="10" FontWeight="Bold"
|
||||
VerticalAlignment="Center" />
|
||||
<Image Margin="8,0,0,0"
|
||||
Source="/Resources/new-icons/close-white.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Height="12" Width="12"
|
||||
MouseDown="Border_MouseDown"
|
||||
MouseUp="CloseImageOptionsPanel_MouseUp" />
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<ui:SimpleStackPanel Margin="6,4,6,4" Spacing="2">
|
||||
<!-- Screenshot Option -->
|
||||
<Border MouseDown="Border_MouseDown" MouseUp="ImageOptionScreenshot_MouseUp"
|
||||
Background="Transparent" CornerRadius="3" Padding="6,4">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#f0f9ff"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image Height="16" Width="16">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||
<GeometryDrawing Brush="#2563eb"
|
||||
Geometry="F0 M24,24z M0,0z M9,3C8.46957,3 7.96086,3.21071 7.58579,3.58579 7.21071,3.96086 7,4.46957 7,5 7,5.26522 6.89464,5.51957 6.70711,5.70711 6.51957,5.89464 6.26522,6 6,6L5,6C4.20435,6 3.44129,6.31607 2.87868,6.87868 2.31607,7.44129 2,8.20435 2,9L2,18C2,18.7956 2.31607,19.5587 2.87868,20.1213 3.44129,20.6839 4.20435,21 5,21L19,21C19.7957,21 20.5587,20.6839 21.1213,20.1213 21.6839,19.5587 22,18.7957 22,18L22,9C22,8.20435 21.6839,7.44129 21.1213,6.87868 20.5587,6.31607 19.7957,6 19,6L18,6C17.7348,6 17.4804,5.89464 17.2929,5.70711 17.1054,5.51957 17,5.26522 17,5 17,4.46957 16.7893,3.96086 16.4142,3.58579 16.0391,3.21071 15.5304,3 15,3L9,3z M9,5L15,5C15,5.79565 15.3161,6.55871 15.8787,7.12132 16.4413,7.68393 17.2044,8 18,8L19,8C19.2652,8 19.5196,8.10536 19.7071,8.29289 19.8946,8.48043 20,8.73478 20,9L20,18C20,18.2652 19.8946,18.5196 19.7071,18.7071 19.5196,18.8946 19.2652,19 19,19L5,19C4.73478,19 4.48043,18.8946 4.29289,18.7071 4.10536,18.5196 4,18.2652 4,18L4,9C4,8.73478 4.10536,8.48043 4.29289,8.29289 4.48043,8.10536 4.73478,8 5,8L6,8C6.79565,8 7.55871,7.68393 8.12132,7.12132 8.68393,6.55871 9,5.79565 9,5z M12,9C10.9391,9 9.92172,9.42143 9.17157,10.1716 8.42143,10.9217 8,11.9391 8,13 8,14.0609 8.42143,15.0783 9.17157,15.8284 9.92172,16.5786 10.9391,17 12,17 13.0609,17 14.0783,16.5786 14.8284,15.8284 15.5786,15.0783 16,14.0609 16,13 16,11.9391 15.5786,10.9217 14.8284,10.1716 14.0783,9.42143 13.0609,9 12,9z M10.5858,11.5858C10.9609,11.2107 11.4696,11 12,11 12.5304,11 13.0391,11.2107 13.4142,11.5858 13.7893,11.9609 14,12.4696 14,13 14,13.5304 13.7893,14.0391 13.4142,14.4142 13.0391,14.7893 12.5304,15 12,15 11.4696,15 10.9609,14.7893 10.5858,14.4142 10.2107,14.0391 10,13.5304 10,13 10,12.4696 10.2107,11.9609 10.5858,11.5858z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<TextBlock Text="截图" FontSize="11" FontWeight="SemiBold"
|
||||
Foreground="#1f2937" VerticalAlignment="Center"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<!-- Select Image Option -->
|
||||
<Border MouseDown="Border_MouseDown" MouseUp="ImageOptionSelectFile_MouseUp"
|
||||
Background="Transparent" CornerRadius="3" Padding="6,4">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#f0f9ff"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image Height="16" Width="16">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||
<GeometryDrawing Brush="#2563eb"
|
||||
Geometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z"/>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<TextBlock Text="选择图片" FontSize="11" FontWeight="SemiBold"
|
||||
Foreground="#1f2937" VerticalAlignment="Center"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
</ui:SimpleStackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<Border x:Name="BoardUndo" Width="60" Height="50" MouseDown="Border_MouseDown"
|
||||
MouseUp="SymbolIconUndo_MouseUp" BorderThickness="0,1,0,1"
|
||||
BorderBrush="#a1a1aa"
|
||||
@@ -5031,7 +5192,7 @@
|
||||
</TransformGroup>
|
||||
</Grid.RenderTransform>
|
||||
<Border ClipToBounds="True" Name="BoardBorderTools"
|
||||
Margin="-105,-138.5,-14,33.5"
|
||||
Margin="-80,-138.5,-39,33.5"
|
||||
CornerRadius="5" Background="#fafafa" Opacity="1"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#2563eb">
|
||||
@@ -5248,93 +5409,6 @@
|
||||
</ui:SimpleStackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<!-- Image Insertion Options Panel -->
|
||||
<Border ClipToBounds="True" Name="BoardImageOptionsPanel" Visibility="Collapsed"
|
||||
Margin="-80,-90,-14,33.5"
|
||||
CornerRadius="5" Background="#fafafa" Opacity="1"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#2563eb">
|
||||
<ui:SimpleStackPanel Margin="0">
|
||||
<Border BorderBrush="#1e3a8a" BorderThickness="0,0,0,1"
|
||||
CornerRadius="5,5,0,0" Background="#2563eb"
|
||||
Padding="8,4">
|
||||
<ui:SimpleStackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextBlock Text="插入图片" Foreground="White"
|
||||
FontSize="10" FontWeight="Bold"
|
||||
VerticalAlignment="Center" />
|
||||
<Image Margin="8,0,0,0"
|
||||
Source="/Resources/new-icons/close-white.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Height="12" Width="12"
|
||||
MouseDown="Border_MouseDown"
|
||||
MouseUp="CloseImageOptionsPanel_MouseUp" />
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<ui:SimpleStackPanel Margin="6,4,6,4" Spacing="2">
|
||||
<!-- Screenshot Option -->
|
||||
<Border MouseDown="Border_MouseDown" MouseUp="ImageOptionScreenshot_MouseUp"
|
||||
Background="Transparent" CornerRadius="3" Padding="6,4">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#f0f9ff"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image Height="16" Width="16">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||
<GeometryDrawing Brush="#2563eb"
|
||||
Geometry="F0 M24,24z M0,0z M9,3C8.46957,3 7.96086,3.21071 7.58579,3.58579 7.21071,3.96086 7,4.46957 7,5 7,5.26522 6.89464,5.51957 6.70711,5.70711 6.51957,5.89464 6.26522,6 6,6L5,6C4.20435,6 3.44129,6.31607 2.87868,6.87868 2.31607,7.44129 2,8.20435 2,9L2,18C2,18.7956 2.31607,19.5587 2.87868,20.1213 3.44129,20.6839 4.20435,21 5,21L19,21C19.7957,21 20.5587,20.6839 21.1213,20.1213 21.6839,19.5587 22,18.7957 22,18L22,9C22,8.20435 21.6839,7.44129 21.1213,6.87868 20.5587,6.31607 19.7957,6 19,6L18,6C17.7348,6 17.4804,5.89464 17.2929,5.70711 17.1054,5.51957 17,5.26522 17,5 17,4.46957 16.7893,3.96086 16.4142,3.58579 16.0391,3.21071 15.5304,3 15,3L9,3z M9,5L15,5C15,5.79565 15.3161,6.55871 15.8787,7.12132 16.4413,7.68393 17.2044,8 18,8L19,8C19.2652,8 19.5196,8.10536 19.7071,8.29289 19.8946,8.48043 20,8.73478 20,9L20,18C20,18.2652 19.8946,18.5196 19.7071,18.7071 19.5196,18.8946 19.2652,19 19,19L5,19C4.73478,19 4.48043,18.8946 4.29289,18.7071 4.10536,18.5196 4,18.2652 4,18L4,9C4,8.73478 4.10536,8.48043 4.29289,8.29289 4.48043,8.10536 4.73478,8 5,8L6,8C6.79565,8 7.55871,7.68393 8.12132,7.12132 8.68393,6.55871 9,5.79565 9,5z M12,9C10.9391,9 9.92172,9.42143 9.17157,10.1716 8.42143,10.9217 8,11.9391 8,13 8,14.0609 8.42143,15.0783 9.17157,15.8284 9.92172,16.5786 10.9391,17 12,17 13.0609,17 14.0783,16.5786 14.8284,15.8284 15.5786,15.0783 16,14.0609 16,13 16,11.9391 15.5786,10.9217 14.8284,10.1716 14.0783,9.42143 13.0609,9 12,9z M10.5858,11.5858C10.9609,11.2107 11.4696,11 12,11 12.5304,11 13.0391,11.2107 13.4142,11.5858 13.7893,11.9609 14,12.4696 14,13 14,13.5304 13.7893,14.0391 13.4142,14.4142 13.0391,14.7893 12.5304,15 12,15 11.4696,15 10.9609,14.7893 10.5858,14.4142 10.2107,14.0391 10,13.5304 10,13 10,12.4696 10.2107,11.9609 10.5858,11.5858z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<TextBlock Text="截图" FontSize="11" FontWeight="SemiBold"
|
||||
Foreground="#1f2937" VerticalAlignment="Center"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<!-- Select Image Option -->
|
||||
<Border MouseDown="Border_MouseDown" MouseUp="ImageOptionSelectFile_MouseUp"
|
||||
Background="Transparent" CornerRadius="3" Padding="6,4">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#f0f9ff"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image Height="16" Width="16">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||
<GeometryDrawing Brush="#2563eb"
|
||||
Geometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z"/>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<TextBlock Text="选择图片" FontSize="11" FontWeight="SemiBold"
|
||||
Foreground="#1f2937" VerticalAlignment="Center"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
</ui:SimpleStackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Width="60" Height="50" MouseDown="Border_MouseDown"
|
||||
@@ -6995,7 +7069,7 @@
|
||||
<Border x:Name="BorderDrawShape" Background="#fafafa" Opacity="1"
|
||||
Visibility="Visible" BorderBrush="#2563eb"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5" Margin="-200,-122,-117,37">
|
||||
CornerRadius="5" Margin="-170,-122,-147,37">
|
||||
<ui:SimpleStackPanel Spacing="0" Orientation="Vertical">
|
||||
<!--<TextBlock FontSize="16" Foreground="{DynamicResource FloatBarForeground}" HorizontalAlignment="Left" Margin="10,8">
|
||||
<Run Text="图形"/>
|
||||
@@ -7011,6 +7085,12 @@
|
||||
<TextBlock Text="几何绘图" Canvas.Left="8" Foreground="White"
|
||||
Padding="0,5" FontSize="11" FontWeight="Bold"
|
||||
TextAlignment="Center" />
|
||||
<Image Margin="295,3.5,0,0"
|
||||
Source="/Resources/new-icons/close-white.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Height="16"
|
||||
Width="16" MouseDown="Border_MouseDown"
|
||||
MouseUp="CloseBordertools_MouseUp" />
|
||||
</Canvas>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
@@ -7325,6 +7405,12 @@
|
||||
<TextBlock Text="橡皮选项" Canvas.Left="8" Foreground="White"
|
||||
Padding="0,5"
|
||||
FontSize="11" FontWeight="Bold" TextAlignment="Center" />
|
||||
<Image Margin="100,4,0,0"
|
||||
Source="/Resources/new-icons/close-white.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Height="16"
|
||||
Width="16" MouseDown="Border_MouseDown"
|
||||
MouseUp="CloseBordertools_MouseUp" />
|
||||
</Canvas>
|
||||
</Border>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Margin="0,8,0,0" Spacing="-2"
|
||||
@@ -7480,7 +7566,7 @@
|
||||
Margin="0,1,0,0" TextAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
<Grid Width="0">
|
||||
<Border ClipToBounds="True" Name="BorderTools" Margin="-133,-156,14,37"
|
||||
<Border ClipToBounds="True" Name="BorderTools" Margin="-103,-156,-16,37"
|
||||
CornerRadius="5" Background="#fafafa" Opacity="1" BorderThickness="1"
|
||||
BorderBrush="#2563eb">
|
||||
<ui:SimpleStackPanel Margin="-1,0,0,0">
|
||||
@@ -7728,6 +7814,12 @@
|
||||
<Canvas Height="24" ClipToBounds="True">
|
||||
<TextBlock Text="手势选项" Canvas.Left="8" Foreground="White" Padding="0,5"
|
||||
FontSize="11" FontWeight="Bold" TextAlignment="Center" />
|
||||
<Image Margin="98,5,0,0"
|
||||
Source="/Resources/new-icons/close-white.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Height="16"
|
||||
Width="16" MouseDown="Border_MouseDown"
|
||||
MouseUp="CloseBordertools_MouseUp" />
|
||||
</Canvas>
|
||||
</Border>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="4" VerticalAlignment="Center"
|
||||
|
||||
@@ -1546,8 +1546,30 @@ namespace Ink_Canvas {
|
||||
|
||||
#region Image Toolbar Event Handlers
|
||||
|
||||
private void BorderImageClone_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
if (selectedUIElement is Image image)
|
||||
{
|
||||
CloneImage(image);
|
||||
}
|
||||
}
|
||||
|
||||
private void BorderImageCloneToNewBoard_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
if (selectedUIElement is Image image)
|
||||
{
|
||||
CloneImageToNewBoard(image);
|
||||
}
|
||||
}
|
||||
|
||||
private void BorderImageRotateLeft_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
if (selectedUIElement is Image image)
|
||||
{
|
||||
RotateImage(image, -90);
|
||||
@@ -1556,14 +1578,38 @@ namespace Ink_Canvas {
|
||||
|
||||
private void BorderImageRotateRight_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
if (selectedUIElement is Image image)
|
||||
{
|
||||
RotateImage(image, 90);
|
||||
}
|
||||
}
|
||||
|
||||
private void GridImageScaleIncrease_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
if (selectedUIElement is Image image)
|
||||
{
|
||||
ScaleImage(image, 1.25); // 放大5%
|
||||
}
|
||||
}
|
||||
|
||||
private void GridImageScaleDecrease_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
if (selectedUIElement is Image image)
|
||||
{
|
||||
ScaleImage(image, 0.8); // 缩小5%
|
||||
}
|
||||
}
|
||||
|
||||
private void BorderImageDelete_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
if (selectedUIElement is Image image)
|
||||
{
|
||||
DeleteImage(image);
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Ink_Canvas.Helpers;
|
||||
@@ -219,6 +220,152 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 克隆图片
|
||||
/// </summary>
|
||||
/// <param name="image">要克隆的图片</param>
|
||||
private void CloneImage(Image image)
|
||||
{
|
||||
if (image == null) return;
|
||||
|
||||
try
|
||||
{
|
||||
// 创建图片的副本
|
||||
var clonedImage = new Image
|
||||
{
|
||||
Source = image.Source,
|
||||
Width = image.Width,
|
||||
Height = image.Height,
|
||||
Stretch = image.Stretch,
|
||||
RenderTransform = image.RenderTransform?.Clone() as Transform
|
||||
};
|
||||
|
||||
// 设置位置,稍微偏移以避免重叠
|
||||
InkCanvas.SetLeft(clonedImage, InkCanvas.GetLeft(image) + 20);
|
||||
InkCanvas.SetTop(clonedImage, InkCanvas.GetTop(image) + 20);
|
||||
|
||||
// 添加鼠标事件处理,使图片可以被选择
|
||||
clonedImage.MouseDown += UIElement_MouseDown;
|
||||
clonedImage.IsManipulationEnabled = true;
|
||||
|
||||
// 添加到画布
|
||||
inkCanvas.Children.Add(clonedImage);
|
||||
|
||||
// 选择新克隆的图片
|
||||
DeselectUIElement();
|
||||
SelectUIElement(clonedImage);
|
||||
|
||||
// 提交到时间机器以支持撤销
|
||||
timeMachine.CommitElementInsertHistory(clonedImage);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 记录错误但不中断程序
|
||||
System.Diagnostics.Debug.WriteLine($"克隆图片时发生错误: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 克隆图片到新页面
|
||||
/// </summary>
|
||||
/// <param name="image">要克隆的图片</param>
|
||||
private void CloneImageToNewBoard(Image image)
|
||||
{
|
||||
if (image == null) return;
|
||||
|
||||
try
|
||||
{
|
||||
// 创建图片的副本
|
||||
var clonedImage = new Image
|
||||
{
|
||||
Source = image.Source,
|
||||
Width = image.Width,
|
||||
Height = image.Height,
|
||||
Stretch = image.Stretch,
|
||||
RenderTransform = image.RenderTransform?.Clone() as Transform
|
||||
};
|
||||
|
||||
// 设置位置,稍微偏移以避免重叠
|
||||
InkCanvas.SetLeft(clonedImage, InkCanvas.GetLeft(image) + 20);
|
||||
InkCanvas.SetTop(clonedImage, InkCanvas.GetTop(image) + 20);
|
||||
|
||||
// 添加鼠标事件处理,使图片可以被选择
|
||||
clonedImage.MouseDown += UIElement_MouseDown;
|
||||
clonedImage.IsManipulationEnabled = true;
|
||||
|
||||
// 创建新页面
|
||||
BtnWhiteBoardAdd_Click(null, null);
|
||||
|
||||
// 添加到新页面的画布
|
||||
inkCanvas.Children.Add(clonedImage);
|
||||
|
||||
// 选择新克隆的图片
|
||||
DeselectUIElement();
|
||||
SelectUIElement(clonedImage);
|
||||
|
||||
// 提交到时间机器以支持撤销
|
||||
timeMachine.CommitElementInsertHistory(clonedImage);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 记录错误但不中断程序
|
||||
System.Diagnostics.Debug.WriteLine($"克隆图片到新页面时发生错误: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缩放图片
|
||||
/// </summary>
|
||||
/// <param name="image">要缩放的图片</param>
|
||||
/// <param name="scaleFactor">缩放因子(大于1为放大,小于1为缩小)</param>
|
||||
private void ScaleImage(Image image, double scaleFactor)
|
||||
{
|
||||
if (image == null) return;
|
||||
|
||||
try
|
||||
{
|
||||
// 获取当前的变换
|
||||
var transformGroup = image.RenderTransform as TransformGroup ?? new TransformGroup();
|
||||
|
||||
// 查找现有的缩放变换
|
||||
ScaleTransform scaleTransform = null;
|
||||
foreach (Transform transform in transformGroup.Children)
|
||||
{
|
||||
if (transform is ScaleTransform st)
|
||||
{
|
||||
scaleTransform = st;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有缩放变换,创建一个新的
|
||||
if (scaleTransform == null)
|
||||
{
|
||||
scaleTransform = new ScaleTransform();
|
||||
transformGroup.Children.Add(scaleTransform);
|
||||
}
|
||||
|
||||
// 设置缩放中心为图片中心
|
||||
scaleTransform.CenterX = image.ActualWidth / 2;
|
||||
scaleTransform.CenterY = image.ActualHeight / 2;
|
||||
|
||||
// 应用缩放因子
|
||||
scaleTransform.ScaleX *= scaleFactor;
|
||||
scaleTransform.ScaleY *= scaleFactor;
|
||||
|
||||
// 应用变换
|
||||
image.RenderTransform = transformGroup;
|
||||
|
||||
// 提交到时间机器以支持撤销
|
||||
// 注意:缩放操作目前不支持撤销,因为需要更复杂的历史记录机制
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 记录错误但不中断程序
|
||||
System.Diagnostics.Debug.WriteLine($"缩放图片时发生错误: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除图片
|
||||
/// </summary>
|
||||
|
||||
@@ -166,6 +166,7 @@ namespace Ink_Canvas {
|
||||
}
|
||||
}
|
||||
|
||||
// ... existing code ...
|
||||
private void ImageRotate45_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||
if (lastBorderMouseDownObject != sender) return;
|
||||
|
||||
@@ -179,7 +180,7 @@ namespace Ink_Canvas {
|
||||
center = m.Transform(center); // 转换为矩阵缩放和旋转的中心点
|
||||
|
||||
// Update matrix to reflect translation/rotation
|
||||
m.RotateAt(45, center.X, center.Y); // 旋转
|
||||
m.RotateAt(45, center.X, center.Y); // 顺时针旋转45度
|
||||
|
||||
var targetStrokes = inkCanvas.GetSelectedStrokes();
|
||||
foreach (var stroke in targetStrokes) stroke.Transform(m, false);
|
||||
@@ -471,7 +472,7 @@ namespace Ink_Canvas {
|
||||
|
||||
// 图片工具栏相关
|
||||
private Border borderImageSelectionControl;
|
||||
private double BorderImageSelectionControlWidth = 150.0; // 3个按钮 + 分隔线的实际宽度
|
||||
private double BorderImageSelectionControlWidth = 490.0; // 6个按钮 + 分隔线的实际宽度
|
||||
private double BorderImageSelectionControlHeight = 80.0;
|
||||
|
||||
// 元素变化监听相关
|
||||
|
||||
Reference in New Issue
Block a user