C#打印预览问题 [英] C# Print Preview Question

查看:82
本文介绍了C#打印预览问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#中显示面板的打印预览

How to Show Print Preview for a Panel in C#

推荐答案

说实话,我不会。

虽然你可以打印屏幕控制,它通常不是一个好主意,因为它有效地采取控件外观和打印的位图。这意味着它使用屏幕颜色,设置和分辨率 - 因此从Win7到Win10的切换将在打印输出中给出不同的结果。



相反,使用 PrintDocument class [ ^ ]打印面板数据内容 - 它并不复杂,包括preveiw,让你准确定义它的外观和外观。它还使打印输出OS独立。
To be honest, I wouldn't.
While you can print screen controls, it's generally not a good idea as it works by effectively taking a bitmap of the controls appearance and printing that. Which means that it uses the screen colours, settings, and resolution - so a switch from Win7 to Win10 will give you different results in your printout.

Instead, use the PrintDocument class[^] to print the panel data content - it's not complicated, includes preveiw, and let's you define exactly what goes where and how it looks. It also makes the printout OS independent.


这篇关于C#打印预览问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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