码迷,mamicode.com
首页 > 其他好文 > 详细

打印二维码

时间:2015-01-29 17:32:04      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:

 QrEncoder qrEncoder = new QrEncoder(ErrorCorrectionLevel.H);
                QrCode qrCode = qrEncoder.Encode(QueryUrl);
                GraphicsRenderer renderer = new GraphicsRenderer(new FixedModuleSize(5, QuietZoneModules.Two), Brushes.Black, Brushes.White);
                string filesrc = System.Environment.CurrentDirectory + Guid.NewGuid().ToString() + ".png";
                using (MemoryStream stream = new MemoryStream())
                {
                    renderer.WriteToStream(qrCode.Matrix, ImageFormat.Png, stream);
                    //e.Graphics.DrawImage(Image.FromStream(stream), this.centerPosition(this.paperWidth, barcode2d.Size.Width), y, (float)this.barcode2d.Size.Width, (float)this.barcode2d.Size.Height);
                    e.Graphics.DrawImage(Image.FromStream(stream), this.centerPosition(this.paperWidth, 175), y, 175, 175);
                }

 

打印二维码

标签:

原文地址:http://www.cnblogs.com/xuguanghui/p/4260210.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!