实现我自己的打印预览? [英] Implementing my own print preview?

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

问题描述

我已经开发了自己的报告控制,它只是绘制控制窗口的客户端DC的CDC上的文本。我有打印功能也工作。报告输出将直接发送到打印机。但是,我想让用户知道报告实际打印之前的输出。

I have developed my own Report Control which is simply nothing but drawing text on a CDC of the control window's client DC. I have got the printing function to work too. The report output is sent to the printer directly. However I want to let the user know the output before the report is actually printed.

我无法使用MFC的打印预览架构,因为我的项目没有使用doc / view架构。我可以自己创建一个打印预览窗口吗? MFC如何处理这个?在屏幕上显示打印机输出时,是否需要进行任何特殊处理或记住?我已经阅读,MFC使用2 DCs打印预览的目的。如果我自定义打印预览,我还需要这样做吗?

I cannot do this using MFC's print preview architecture as my project is not using the doc/view architecture. Is it possible for me to create a print preview window myself ? How does MFC handle this ? Are there any special processing need to be done or keep in mind when showing the printer output on screen ? I've read that MFC used 2 DCs for print preview purposes. Do I need to do this as well if Im goin for a custom print preview ?

您的意见非常感谢!
tia。

Your input is highly appreciated ! tia.

我使用Visual Studio 6,没有选项将其更改为更新的版本,因为我没有办法添加doc /视图支持。

P.S. i use Visual Studio 6 and there is no option to change this to a newer version just as there is no way for me to add doc/view support.

推荐答案

在MFC中有一个类CPreviewView。也许你可以找到一种方法来实例化它没有MDI结构。

There is a class CPreviewView in MFC. Maybe you can find a way to instantiate it without MDI structure.

否则,你可以简单地在屏幕上绘制任何你在打印机DC上绘画。只要记住,你可能需要缩小以降低dpi。

Otherwise, you can simply paint on screen whatever you are painting on the printer DC. Just remember that you will probably need to scale it down for lower dpi.

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

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