printing - How to print a BMP from file or HDC
问题描述
I am trying to add printing capability to my Windows app. So far, I have succeeded in (1) painting the image into an HDC; (2) saving it as a BMP file; (3) creating a BITMAPINFOHEADER and pixmap in memory; and (4) creating an HBITMAP object.
How can I send any of these to my laser printer? (I don't want to use any third-party app, but rather do it using API calls).
Any suggestions?
解决方案
看起来您需要使用 XPS Document API,除非您的打印机驱动程序接受 bmp 文件作为输入(这似乎不太可能)。另一种选择是将输出生成为 postscript 文件(许多打印机接受 .ps 文件作为输入;至少,他们曾经这样做过。检查打印机的文档)。
如果您选择 XPS 文档路径,请在此处查看文档:https ://docs.microsoft.com/en-us/windows/win32/printdocs/documents 显然,在 Windows 中,您现在可以将 XPS 文档发送到您的打印后台处理程序,它应该可以工作。我没有测试过这个。
推荐阅读
- amazon-web-services - AWS API Gateway 和 Elastic Cloud 托管的 Elasticsearch 之间的身份验证
- html - HTML 表单接受/拒绝按钮
- cloud - Is it possible to compare different pictures of an object on different backgrounds to manage inventory?
- arrays - Ruby替换数组中的元素
- javascript - 滚动缩放视差
- javascript - Javascript 构造函数调用
- windows - 在 Anaconda Prompt 中访问文件时权限被拒绝
- azure - 无法从 VS 部署到受保护的 Service Fabric 群集
- hadoop - 无法在 hdfs 的目录下创建子目录
- gcov - Catkin_make 与 Gcov