fix:issue #219
This commit is contained in:
@@ -1467,8 +1467,8 @@
|
|||||||
<Border ClipToBounds="True" Width="324" Height="182">
|
<Border ClipToBounds="True" Width="324" Height="182">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Image Source="Resources/PresentationExample/page.jpg" Width="324" Height="182" Stretch="Fill"></Image>
|
<Image Source="Resources/PresentationExample/page.jpg" Width="324" Height="182" Stretch="Fill"></Image>
|
||||||
<Image Source="Resources/PresentationExample/toolbar.png" Height="16" Width="324"
|
<Image Name="PPTBtnPreviewToolbar" Source="Resources/PresentationExample/toolbar.png" Height="16" Width="324"
|
||||||
VerticalAlignment="Bottom" HorizontalAlignment="Center" Stretch="Fill" />
|
VerticalAlignment="Bottom" HorizontalAlignment="Center" Stretch="Uniform" />
|
||||||
<Image Name="PPTBtnPreviewLS" Source="Resources/PresentationExample/sidebar-white.png" Width="10" Height="30"
|
<Image Name="PPTBtnPreviewLS" Source="Resources/PresentationExample/sidebar-white.png" Width="10" Height="30"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
|
VerticalAlignment="Center" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
|
||||||
<Image.RenderTransform>
|
<Image.RenderTransform>
|
||||||
|
|||||||
@@ -1054,6 +1054,34 @@ namespace Ink_Canvas
|
|||||||
|
|
||||||
PPTBtnPreviewLBTransform.X = scaledMarginOffset + (lbPosition * scaleX);
|
PPTBtnPreviewLBTransform.X = scaledMarginOffset + (lbPosition * scaleX);
|
||||||
PPTBtnPreviewRBTransform.X = -(scaledMarginOffset + (rbPosition * scaleX));
|
PPTBtnPreviewRBTransform.X = -(scaledMarginOffset + (rbPosition * scaleX));
|
||||||
|
|
||||||
|
// 计算工具栏尺寸
|
||||||
|
var dpiScaleX = 1.0;
|
||||||
|
var dpiScaleY = 1.0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var source = PresentationSource.FromVisual(this);
|
||||||
|
if (source?.CompositionTarget != null)
|
||||||
|
{
|
||||||
|
var transform = source.CompositionTarget.TransformToDevice;
|
||||||
|
dpiScaleX = transform.M11;
|
||||||
|
dpiScaleY = transform.M22;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
dpiScaleX = 1.0;
|
||||||
|
dpiScaleY = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算工具栏的实际尺寸
|
||||||
|
const double baseToolbarHeight = 20.0;
|
||||||
|
double actualToolbarHeight = baseToolbarHeight * dpiScaleY;
|
||||||
|
double scaledToolbarHeight = actualToolbarHeight * scaleY;
|
||||||
|
|
||||||
|
// 设置工具栏尺寸
|
||||||
|
PPTBtnPreviewToolbar.Height = scaledToolbarHeight;
|
||||||
|
PPTBtnPreviewToolbar.Width = previewWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ToggleSwitchShowCursor_Toggled(object sender, RoutedEventArgs e)
|
private void ToggleSwitchShowCursor_Toggled(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user