控制-> RenderTargetBitmap->图像控制->打印输出模糊 [英] Control -> RenderTargetBitmap -> Image control -> Print Out is Blurry

查看:92
本文介绍了控制-> RenderTargetBitmap->图像控制->打印输出模糊的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如受试者所说,我正在这样做

As the subject states, I am doing this

Control(例如DataGrid)->

Control (DataGrid for example) ->

RenderTargetBitmap->

RenderTargetBitmap ->

图像控制(为了执行一些预处理,此处未显示)->

Image control (in order to perform some pre-processing, not shown here) ->

打印输出(但是此打印输出非常模糊,如下所示)

Print Out (This print out is however very Blurry as shown below)

仅当控件的高度很大时,这似乎是一个问题.尝试减少网格中的行数,这种模糊效果就消失了.

This seems to be an issue only if the Control's Height is large. Try reducing the number of rows in the grid and this blurry effect is gone.

这是 您可以编译并运行的项目.

Here is a project that you can compile and run.

WPF专家,请帮忙.

WPF Experts, please help.

预先感谢.

推荐答案

您好,当您在GridPrintPaginator中创建DocumentPage时,我快速浏览了一下您的代码.GetPage,您可以将DataGrid传递给DocumentPage构造函数的第一个参数,因为DataGrid是可视的,因此无需将其绘制到ImageSource 并将ImageSource设置为Image并将Image添加到Canvas并以视觉形式返回Canvas.

Hi, I take a quick look at your code, when you create a DocumentPage in GridPrintPaginator.GetPage, you can pass DataGrid to the first parameter of DocumentPage constructor, because DataGrid is a Visual, you don't need to draw it to ImageSource and set the ImageSource to Image and add Image to Canvas and return Canvas as a Visual.

如果您将DataGrid用作Visual,我认为您会看到清晰的打印文档.

I think you will see the clear print document if you use DataGrid as a Visual.


这篇关于控制-> RenderTargetBitmap->图像控制->打印输出模糊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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