我需要打印机编程方面的帮助 [英] I need help with printer programming

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

问题描述

朋友,我想使用C ++程序打印文件内容.请告诉我我该怎么做.我对打印机编程一无所知.请帮助我解决这个问题.我希望它在C ++上执行.如果您可以提供实现它的代码,那么对我会更有用.

Hi friends I want to print file contents using C++ program. Please tell me how I can do this. I don''t know anything about printer programming. Please help me to sort out this problem. I want it to perform on C++. If you can provide me code to implement it, then it will be more helpful to me.

推荐答案

不直接支持使用C或C ++打印.在C ++中,可以在MFC中使用类.在C语言中,我不确定您要使用什么.您需要弄清楚是C还是C ++?
There''s no direct support for printing in C, or C++. In C++ you can use classes in MFC. In C, I''m not sure what you''d use. You need to be clear, is it C, or C++ ?


好吧,您对所使用的技术一无所知.您在使用MFC,win32,...吗?
无论如何,请查看本节 [
Well, you are not clear at all as which technology you are using. Are you using MFC, win32, ... ?
Anyway, take a look at this section[^] on CP. You most probably will find something useful.


基本上,打印意味着绘制到打印机的设备上下文. 它与在屏幕上绘制完全相同.
大多数时候,绘制到屏幕上的代码与用于打印的代码完全相同.
只有设备上下文从屏幕的上下文更改为打印机.
所有的GDI功能(例如TextOutLineToRectangleEllipse等)都可以用于打印.
Basically, printing means drawing to the printer''s device context.
It is exactly the same as drawing to the screen.
Most of the time the code to draw to the screen is exactly the same as that used for printing.
Only the device context changes from that of the screen to the printer.
All GDI functions like TextOut, LineTo, Rectangle, Ellipse etc. can be used for printing.


这篇关于我需要打印机编程方面的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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