问题描述
各位大神好,在下需要打印这种电影票长度78*84怎么将这个用drawstring()绘出。一次要打印很多张所以要实现多页打印。没接触这方面所以很棘手,忘有经验的同行指导一下最好能贴出代码。
解决方案
解决方案二:
图样如上
解决方案三:
Bitmapbmp=newBitmap(78,84);using(Graphicsg=Graphics.FromImage(bmp)){g.InterpolationMode=System.Drawing.Drawing2D.InterpolationMode.Low;g.SmoothingMode=System.Drawing.Drawing2D.SmoothingMode.None;g.CompositingQuality=System.Drawing.Drawing2D.CompositingQuality.Default;g.DrawString("",font,Brushe,point);}PrintDocumentpd=newPrintDocument();if(PrinterName!=null){pd.PrinterSettings.PrinterName=PrinterName;pd.PrintController=newStandardPrintController();//单的尺寸pd.DefaultPageSettings.PaperSize=newPaperSize("连接纸21.59*13.9",850,550);}pd.PrintPage+=(sender,e)=>e.Graphics.DrawImage(bmp,newPoint(0,0));pd.Print();
时间: 2024-10-03 00:04:14