[UWP] [C#] [Win2D]使用PrintDocument使用Win2D CanvasControl进行打印时不显示任何内容。 [英] [UWP][C#][Win2D]Printing with Win2D CanvasControl using PrintDocument does not show anything.

查看:71
本文介绍了[UWP] [C#] [Win2D]使用PrintDocument使用Win2D CanvasControl进行打印时不显示任何内容。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


我正在使用Windows Universal母版打印示例将打印添加到我的应用程序中。但是在我的打印页面(称为PrintPage)上,我有一个Win2D CanvasControl。在打印预览面板中,页面正确呈现,显示TextBlock等...除了
Win2D CanvasControl,它没有显示任何内容。我已经通过使用Frame.Navigate(typeof(PrintPage))查看打印页面确保一切正常。


检查Win2D文档它有自己的打印类CanvasPrintDocument 。但是我不想使用它,因为打印页面有几个TextBlocks和其他XAML控件。 


有没有办法使用  PrintDocument打印CanvasControl?如果没有,我是否使用Win2D CanvasBitmap.SaveAsync()保存到流并使用图像控件显示图形?


谢谢


解决方案

嗨FishInPond,


是的,我可以重现这个问题。预览时PrintDocument不显示CanvasControl。


似乎可以将CanvasControl保存为流并将其显示在Image控件中。


我会调查此事。 


祝你好运,


Roy



Hi

I'm using the Windows Universal master printing sample to add printing to my app. However on my print Page (called PrintPage) I have a Win2D CanvasControl. In the print preview panel the page is rendered correctly, showing TextBlock etc... except for the Win2D CanvasControl, it does not show anything. I've made sure that everything is working correctly by using Frame.Navigate(typeof(PrintPage)) to view the print page.

Checking the Win2D docs it has it's own printing class CanvasPrintDocument. However I do not want to use this as the print Page has a few TextBlocks and other XAML controls. 

Is there a way to print CanvasControl using PrintDocument? If not, do I use Win2D CanvasBitmap.SaveAsync() to save to a stream and display the graphics using an Image control?

Thanks

解决方案

Hi FishInPond,

Yes I could reproduce the problem. The PrintDocument does not show the CanvasControl when previewing.

It seems to be possible to save the CanvasControl as stream and display it in an Image control.

I'll investigating this. 

Best regards,

Roy


这篇关于[UWP] [C#] [Win2D]使用PrintDocument使用Win2D CanvasControl进行打印时不显示任何内容。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆