fix:issue #219
This commit is contained in:
+15
-12
@@ -1465,36 +1465,37 @@
|
||||
<TextBlock Margin="0,0,0,8" Text="PPT翻页按钮" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="20" />
|
||||
<Border ClipToBounds="True" Width="324" Height="182">
|
||||
<Grid>
|
||||
<Image Source="Resources/PresentationExample/page.jpg"></Image>
|
||||
<Image Source="Resources/PresentationExample/toolbar.png" Height="16"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Center" />
|
||||
<Image Name="PPTBtnPreviewLS" Source="Resources/PresentationExample/sidebar-white.png" Width="10"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" >
|
||||
<Viewbox Stretch="Uniform" StretchDirection="Both">
|
||||
<Grid Width="324" Height="182">
|
||||
<Image Source="Resources/PresentationExample/page.jpg" Width="324" Height="182" Stretch="Fill"></Image>
|
||||
<Image Source="Resources/PresentationExample/toolbar.png" Height="16" Width="324"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Center" Stretch="Fill" />
|
||||
<Image Name="PPTBtnPreviewLS" Source="Resources/PresentationExample/sidebar-white.png" Width="10" Height="40"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
|
||||
<Image.RenderTransform>
|
||||
<TransformGroup>
|
||||
<TranslateTransform x:Name="PPTBtnPreviewLSTransform"/>
|
||||
</TransformGroup>
|
||||
</Image.RenderTransform>
|
||||
</Image>
|
||||
<Image Name="PPTBtnPreviewRS" Source="Resources/PresentationExample/sidebar-white.png" Width="10"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" >
|
||||
<Image Name="PPTBtnPreviewRS" Source="Resources/PresentationExample/sidebar-white.png" Width="10" Height="40"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
|
||||
<Image.RenderTransform>
|
||||
<TransformGroup>
|
||||
<TranslateTransform x:Name="PPTBtnPreviewRSTransform"/>
|
||||
</TransformGroup>
|
||||
</Image.RenderTransform>
|
||||
</Image>
|
||||
<Image Name="PPTBtnPreviewLB" Source="Resources/PresentationExample/bottombar-white.png" Height="10"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5">
|
||||
<Image Name="PPTBtnPreviewLB" Source="Resources/PresentationExample/bottombar-white.png" Height="10" Width="40"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
|
||||
<Image.RenderTransform>
|
||||
<TransformGroup>
|
||||
<TranslateTransform x:Name="PPTBtnPreviewLBTransform"/>
|
||||
</TransformGroup>
|
||||
</Image.RenderTransform>
|
||||
</Image>
|
||||
<Image Name="PPTBtnPreviewRB" Source="Resources/PresentationExample/bottombar-white.png" Height="12"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5">
|
||||
<Image Name="PPTBtnPreviewRB" Source="Resources/PresentationExample/bottombar-white.png" Height="12" Width="40"
|
||||
VerticalAlignment="Bottom" HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
|
||||
<Image.RenderTransform>
|
||||
<TransformGroup>
|
||||
<TranslateTransform x:Name="PPTBtnPreviewRBTransform"/>
|
||||
@@ -1502,6 +1503,7 @@
|
||||
</Image.RenderTransform>
|
||||
</Image>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="在 PPT 模式下显示翻页按钮"
|
||||
@@ -9773,3 +9775,4 @@
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
|
||||
@@ -1026,23 +1026,34 @@ namespace Ink_Canvas
|
||||
PPTBtnPreviewRS.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
// 计算预览区域的缩放比例
|
||||
double previewScaleY = 182.0 / SystemParameters.PrimaryScreenHeight;
|
||||
double previewScaleX = 324.0 / SystemParameters.PrimaryScreenWidth;
|
||||
// 获取当前屏幕的实际尺寸(考虑DPI缩放)
|
||||
var actualScreenWidth = SystemParameters.PrimaryScreenWidth;
|
||||
var actualScreenHeight = SystemParameters.PrimaryScreenHeight;
|
||||
|
||||
double sideButtonScaleFactor = 1.9;
|
||||
// 预览区域固定尺寸
|
||||
const double previewWidth = 324.0;
|
||||
const double previewHeight = 182.0;
|
||||
|
||||
// 计算缩放比例(预览区域与实际屏幕的比例)
|
||||
double scaleX = previewWidth / actualScreenWidth;
|
||||
double scaleY = previewHeight / actualScreenHeight;
|
||||
|
||||
// 获取按钮位置设置
|
||||
double rsPosition = Settings.PowerPointSettings.PPTRSButtonPosition;
|
||||
double lsPosition = Settings.PowerPointSettings.PPTLSButtonPosition;
|
||||
double lbPosition = Settings.PowerPointSettings.PPTLBButtonPosition;
|
||||
double rbPosition = Settings.PowerPointSettings.PPTRBButtonPosition;
|
||||
|
||||
PPTBtnPreviewRSTransform.Y = -(rsPosition * 2 * previewScaleY / sideButtonScaleFactor);
|
||||
PPTBtnPreviewLSTransform.Y = -(lsPosition * 2 * previewScaleY / sideButtonScaleFactor);
|
||||
// 计算侧边按钮位置(Y轴偏移)
|
||||
PPTBtnPreviewRSTransform.Y = -(rsPosition * scaleY);
|
||||
PPTBtnPreviewLSTransform.Y = -(lsPosition * scaleY);
|
||||
|
||||
// 计算底部按钮位置(X轴偏移)
|
||||
const double bottomMarginOffset = 6.0;
|
||||
double scaledMarginOffset = bottomMarginOffset * scaleX;
|
||||
|
||||
double bottomButtonScaleFactor = 1.2;
|
||||
double leftMarginOffset = 6 * previewScaleX;
|
||||
PPTBtnPreviewLBTransform.X = leftMarginOffset + (Settings.PowerPointSettings.PPTLBButtonPosition * previewScaleX / bottomButtonScaleFactor);
|
||||
PPTBtnPreviewRBTransform.X = -(leftMarginOffset + (Settings.PowerPointSettings.PPTRBButtonPosition * previewScaleX / bottomButtonScaleFactor));
|
||||
PPTBtnPreviewLBTransform.X = scaledMarginOffset + (lbPosition * scaleX);
|
||||
PPTBtnPreviewRBTransform.X = -(scaledMarginOffset + (rbPosition * scaleX));
|
||||
}
|
||||
|
||||
private void ToggleSwitchShowCursor_Toggled(object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user