|
@@ -502,7 +502,7 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
/// <summary>
|
|
|
/// 获取对应大纲所需的缩略图数据
|
|
|
/// </summary>
|
|
|
- public WriteableBitmap LoadPreview(OutlineNode outlineNode)
|
|
|
+ public WriteableBitmap LoadPreview(OutlineNode outlineNode,int Width,int Height)
|
|
|
{
|
|
|
CPDFPage page = PDFViewer.Document.PageAtIndex(Convert.ToInt32(outlineNode.PageIndex) - 1);
|
|
|
Size size = PDFViewer.Document.GetPageSize(Convert.ToInt32(outlineNode.PageIndex) - 1);
|
|
@@ -516,7 +516,7 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
{
|
|
|
zoomXY.Y = 0;
|
|
|
}
|
|
|
- Size zoomSize = new Size((int)(size.Width * outlineNode.Zoom), (int)(size.Height * outlineNode.Zoom));
|
|
|
+ Size zoomSize = new Size((int)(Width * outlineNode.Zoom), (int)(Height * outlineNode.Zoom));
|
|
|
bmpData = new byte[(int)(zoomSize.Width * zoomSize.Height * 4)];
|
|
|
WirteBitmap = new WriteableBitmap((int)zoomSize.Width, (int)zoomSize.Height, 96, 96, PixelFormats.Bgra32, null);
|
|
|
|
|
@@ -524,7 +524,7 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
{
|
|
|
return null;
|
|
|
}
|
|
|
- page.RenderPageBitmapWithMatrix((float)outlineNode.Zoom, new Rect(zoomXY.X, zoomXY.Y, zoomSize.Width, zoomSize.Height), 0xFFFFFFFF, bmpData, 1, true);
|
|
|
+ page.RenderPageBitmapWithMatrix((float)outlineNode.Zoom, new Rect(zoomXY.X, size.Height-zoomXY.Y, zoomSize.Width, zoomSize.Height), 0xFFFFFFFF, bmpData, 1, true);
|
|
|
WirteBitmap.WritePixels(new Int32Rect(0, 0, (int)zoomSize.Width, (int)zoomSize.Height), bmpData, WirteBitmap.BackBufferStride, 0);
|
|
|
WirteBitmap.Freeze();
|
|
|
return WirteBitmap;
|