C++、win32、gdi 打印:DrawEdge 达不到 DrawText?
我正在尝试使用函数 DrawEdge 和 DrawText (http://msdn.microsoft.com/en-us/library/ms534882.aspx 和 http://msdn.microsoft.com/en-us/library/ms533909.aspx)。 它们工作得很好,但是,当我试图到达纸张底部(距离纸张大约 35 毫米)时,线条就停止绘制了。 我认为这是我的打印机的限制。 然而,当我绘制文本时,我的打印机在打印时没有任何问题,甚至更低。 有没有办法让 DrawEdge 在那里画线? 还有其他方法可以做到这一点吗? 这是一个错误吗?
I am trying to print (using a printer, on paper, not on a screen) lines and text, using the the function DrawEdge and DrawText (http://msdn.microsoft.com/en-us/library/ms534882.aspx and http://msdn.microsoft.com/en-us/library/ms533909.aspx). They work quite fine, however, when I try to reach the bottom of my paper (about 35 milimeter away from it) the line simply stops being drawn. I thought this was a limit of my printer. However, when I draw text, my printer has no trouble printing there and even lower. Is there a way for DrawEdge to draw lines there? Is there another method to do this? Is this a bug?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以想到几个原因:
在绘制边缘时设置了一个剪切区域,而在绘制文本时设置了不同的剪切区域。
在绘制文本
剪切区域已设置,但打印机并未一致地剪切文本。 有些打印机会打印整个字符,即使只有部分字符位于剪切区域内。 您可以使用
GetDeviceCaps
和TEXTCAPS
来检查其文本剪辑功能。 如果是这种情况,可能会显示剪切区域底部附近打印的文本,但其他类型的图形(如线条)将被剪切。您对页面的可打印区域有误。 这是什么类型的打印机? 许多打印机无法在距底边 35 毫米的范围内进行打印。 驱动程序将什么报告为可打印区域? (使用
GetDeviceCaps
与PHYSICALOFFSETY
和PHYSICALHEIGHT
来确定您实际可以打印的页面高度。)祝你好运!
I can think of a few reasons:
You have a clipping region set when you're drawing the edge that's set differently when you're drawing text.
The clipping region is set, but the printer isn't consistently clipping the text. Some printers will print an entire character even if only part of it is inside the clipping region. You can check its text clipping abilities by using
GetDeviceCaps
withTEXTCAPS
. If this is the case, the text printing right near the bottom of the clipping region might show but other types of graphics (like lines) will get clipped.You're mistaken about the printable region of the page. What type of printer is this? Many printers cannot print within 35 mm of the bottom edge. What does the driver report as the printable region? (Use
GetDeviceCaps
withPHYSICALOFFSETY
andPHYSICALHEIGHT
to determine how low on the page you can actually print.)Good luck!