男式棉衣,奥迈特,建阳租房
winform中使用zxing和graphics实现自定义绘制二维码布局:
https://blog.csdn.net/badao_liumang_qizhi/article/details/100127885
在上面实现将二维码显示在picturebox之中之后,将其打印。
页面拖拽一个printdocument控件。
拖拽之后的效果
然后再拖拽一个button按钮,双击进入其点击事件中
private void button7_click(object sender, eventargs e) { printdialog myprintdg = new printdialog(); myprintdg.document = printdocument1; if (myprintdg.showdialog() == dialogresult.ok) { try { printdocument1.print(); } catch { //停止打印 printdocument1.printcontroller.onendprint(printdocument1, new system.drawing.printing.printeventargs()); } } }
找到页面设计器中拖拽的printdocument控件上,右击属性,找到事件列表,然后双击其printpage事件
编写如下代码:
private void printdocument1_printpage(object sender, printpageeventargs e) { e.graphics.drawimage(picturebox1.image, 20, 20); }
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论