1
我一直在閱讀所有內容,但似乎找不到任何使用PrintVisual(...)打印窗口而不調用Show( ) 在上面。有沒有人可以提供幫助?如果即使說它不能發生,所以我可以尋找替代解決方案。是否有可能在未調用Show()的窗口上使用PrintVisual
此線程:Best method to print using wpf 4 似乎是很多人蔘考,但它仍然需要調用Show()。
<Window x:Class="Paymax.Printing.PrintPayAdvice"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<DockPanel>
<StackPanel>
<TextBlock Text="Testing 123" />
</StackPanel>
</DockPanel>
</Window>
我試過了,但沒有先調用wpfWindow.Show()的ActualHeight和ActualWidth的都是0.0這麼一個空白頁會打印。 –
讓我看看你的控制。 –
編輯的問題顯示窗口 –