public void UpdatePages() { PreviewPages.Clear(); if (FLayoutLocked) { return; } for (int i = 0; i < PreparedPages.Count; i++) { SizeF pageSize = PreparedPages.GetPageSize(i); PreviewPages.AddPage(pageSize, Zoom); } PreviewPages.LayoutPages(Width - SystemInformation.VerticalScrollBarWidth); FLocked = false; UpdatePageNumbers(); Size maxSize = PreviewPages.GetMaxSize(); if (maxSize.Width > Width) { maxSize.Height += SystemInformation.HorizontalScrollBarHeight; } if (maxSize.Height > Height) { maxSize.Width += SystemInformation.VerticalScrollBarWidth; } AutoScrollMinSize = maxSize; SetPageNo(PageNo, false); Refresh(); }
public void ZoomWholePage() { if (Disabled) { return; } SizeF pageSize = FPreparedPages.GetPageSize(PageNo - 1); if (pageSize.Width / Workspace.ClientSize.Width > pageSize.Height / Workspace.ClientSize.Height) { Zoom = (Workspace.ClientSize.Width - 20) / pageSize.Width; } else { Zoom = (Workspace.ClientSize.Height - 20) / pageSize.Height; } }