add:pdf插入
This commit is contained in:
@@ -20,6 +20,7 @@ namespace Ink_Canvas.Controls
|
|||||||
private uint _currentIndex;
|
private uint _currentIndex;
|
||||||
private bool _compressLargePictures;
|
private bool _compressLargePictures;
|
||||||
private bool _isPagingBusy;
|
private bool _isPagingBusy;
|
||||||
|
private bool _layoutSizeCommitted;
|
||||||
|
|
||||||
/// <summary>页码或可翻页状态变化(用于更新侧栏)。</summary>
|
/// <summary>页码或可翻页状态变化(用于更新侧栏)。</summary>
|
||||||
public event EventHandler PageNavigationStateChanged;
|
public event EventHandler PageNavigationStateChanged;
|
||||||
@@ -107,9 +108,17 @@ namespace Ink_Canvas.Controls
|
|||||||
|
|
||||||
BitmapSource display = ApplyCompressionIfNeeded(raw);
|
BitmapSource display = ApplyCompressionIfNeeded(raw);
|
||||||
_pageImage.Source = display;
|
_pageImage.Source = display;
|
||||||
// 每页尺寸可能不同,与图片一致按当前页位图更新布局,避免翻页后内容被裁切或“消失”
|
if (!_layoutSizeCommitted)
|
||||||
Width = display.PixelWidth;
|
{
|
||||||
Height = display.PixelHeight;
|
bool callerSized = !double.IsNaN(Width) && Width > 0 && !double.IsNaN(Height) && Height > 0;
|
||||||
|
if (!callerSized)
|
||||||
|
{
|
||||||
|
Width = display.PixelWidth;
|
||||||
|
Height = display.PixelHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
_layoutSizeCommitted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user