我正在使用C#创建ITexSharp文件。现在我需要在Itextshpar中创建一个二维码。我使用Zen Barcorde dll来创建QRCode,我在图片框中创建代码。但是我不能将图片框对象转换为与ITexSharp图像对象一起使用的图像。
下面是我的代码:
Zen.Barcode.CodeQrBarcodeDraw qrCode = Zen.Barcode.BarcodeDrawFactory.CodeQr;
PictureBox picQRImage = new PictureBox();
picQRImage.Image = qrCode.Draw("12245654", 50);
Image img = qrCode.Draw(pStrNuFactura, 50); //Can not convert explicit
Image img = (Image) qrCode.Draw(pStrNuFactura, 50); //Not working任何帮助都将不胜感激。
发布于 2018-04-03 08:16:37
谢谢你的帮助。我的解决方案是:
System.Drawing.Image imgZenBarcode;
iTextSharp.text.Image imgQRCode;
Zen.Barcode.CodeQrBarcodeDraw qrCode = Zen.Barcode.BarcodeDrawFactory.CodeQr;
imgZenBarcode = qrCode.Draw( "123456", 50);
imgQRCode = iTextSharp.text.Image.GetInstance(imgZenBarcode, System.Drawing.Imaging.ImageFormat.Png);https://stackoverflow.com/questions/49523214
复制相似问题