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); }
时间: 2024-10-31 01:42:18