gpt4 book ai didi

WPF:您如何在横向模式下打印?

转载 作者:行者123 更新时间:2023-12-04 13:29:12 24 4
gpt4 key购买 nike

找到 this function在线,效果很好......除了我不知道如何将它默认为横向打印。

private void PrintClick(object sender, RoutedEventArgs e)
{
PrintDialog dialog = new PrintDialog();
if (dialog.ShowDialog() == true)
{ dialog.PrintVisual(_PrintCanvas, "My Canvas"); }
}

实际上如何设置默认值以将我的 wpf 内容打印为横向模式?

最佳答案

编辑:固定变量名称,由@SHIN JaeGuk 提及

private void PrintClick(object sender, RoutedEventArgs e)
{
PrintDialog dialog = new PrintDialog();
if (dialog.ShowDialog() == true)
{
//Set PageOrientation to Landscape
dialog.PrintTicket.PageOrientation = PageOrientation.Landscape;
dialog.PrintVisual(_PrintCanvas, "My Canvas");
}
}

关于WPF:您如何在横向模式下打印?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5300802/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com