Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
For Each r As Row In Tables("生产指令单_明细").Rows
bar.Code = "产品编码: " & r("产品编码") & vbCrlf & "订单编号:" & r("订单编号") & vbCrlf & " 生产数量:" & r("生产数量") & vbCrlf & " 物料编码:" & r("物料编码")
bar.SaveImage(ProjectPath & "Images\test.wmf",300)
Dim imgback As image = getimage(ProjectPath & "Images\test.wmf") '生成的二维码图片
Dim bmp As new bitmap(imgback.width, imgback.height)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bmp)
g.DrawImage(imgback, 0, 0, imgback.Width, imgback.Height)
Dim img = getimage(ProjectPath & "Images\ABC_Log.jpg") '准备添加的logo
Dim x As Integer = (imgback.width - img.width) / 2 'Logo在二维码中的位置
Dim y As Integer = (imgback.height - img.height) / 2
g.DrawImage(img, x, y, img.Width, img.Height) '合并图片
bmp.Save(ProjectPath & "Images\001.jpg")
bmp.Save(ProjectPath & "Images\" & r("产品编码") & ".jpg")
bmp.dispose
Next
上述代码,蓝色的运行就没问题,但采用表中每行动态的产品编码生成图片名称时就出错,显示非法路径,为什么?
谢谢!