打印功能在c#中不起作用

编程入门 行业动态 更新时间:2024-10-11 23:26:20
本文介绍了打印功能在c#中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 在这里,我想打印一个winform,因为我添加了以下编码行,但它无法正常工作。我期待着您的宝贵建议

Hi All, Here I want to print a winform for that I have addded the following line of coding but it''s not working properly. I am looking forward to your valuable suggestions

void PrintImage(object o, PrintPageEventArgs e) { int x = SystemInformation.WorkingArea.X; int y = SystemInformation.WorkingArea.Y; int width = this.Width; int height = this.Height; Rectangle bounds = new Rectangle(x, y, width, height); Bitmap img = new Bitmap(width, height); this.DrawToBitmap(img, bounds); Point p = new Point(100, 100); e.Graphics.DrawImage(img, p); } private void button2_Click(object sender, EventArgs e) { pd.PrintPage += new PrintPageEventHandler(PrintImage); pd.Print(); }

谢谢&此致, Soumya 代码块固定[/ edit]

推荐答案

http:// msdn。 microsoft/en-us/library/aa287529(v=vs.71).aspx [ ^ ]

更多推荐

打印功能在c#中不起作用

本文发布于:2023-11-27 22:37:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639883.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中不   功能

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!