我正在尝试将我的视觉效果打印到多页 xps 中。第一页正在工作,但其他页面为空白。
Dim xP As Integer = 0
Dim yP As Integer = 0
xP = Math.Ceiling(WorkFlowCanvas.Width / pageWidth)
yP = Math.Ceiling(WorkFlowCanvas.Height / pageHeight)
Dim collator = writer.CreateVisualsCollator()
collator.BeginBatchWrite()
For y = 1 To yP
For x = 1 To xP
Dim o As New Canvas
o = New CanvasCreator().GenerateCanvas()
Dim sv As New ScrollViewer
sv.Height = 1200
sv.Width = 800
sv.Content = o
sv.ScrollToHorizontalOffset(x - 1 * sv.Width)
sv.ScrollToVerticalOffset(y - 1 * sv.Height)
sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled
sv.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled
collator.Write(sv)
Next
Next
collator.Write(Me)
collator.EndBatchWrite()
通过在 xaml 中制作视觉效果并打印它,我注意到滚动查看器总是在编写内容之前向上滚动内容(滚动条不移动)。有没有办法“冻结”滚动查看器?