我正在用KeepAutomation构建Code 128条形码的Label打印机。打印后不能删除VB.NET中的条形码图像(KeepAutomation)
在该过程实际上我:
编码数据与KeepAutomation引用模块
Private Sub MakeImage() Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode barcode.Symbology = KeepAutomation.Barcode.Symbology.Code128Auto barcode.CodeToEncode = Me.txtCatNum.Text barcode.X = 2 barcode.Y = 100 barcode.BottomMargin = 0 barcode.LeftMargin = 0 barcode.RightMargin = 0 barcode.TopMargin = 0 barcode.DisplayText = True barcode.ChecksumEnabled = True barcode.DisplayChecksum = True barcode.Orientation = KeepAutomation.Barcode.Orientation.Degree0 barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel barcode.DPI = 72 barcode.TextFont = New Font("Arial", 26.0F, FontStyle.Regular) barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg barcode.generateBarcodeToImageFile(FileToUse)
条形码创建从编码数据的JPEG图像(具有静态名称给硬盘驱动器上的特定位置)
将图像放置在PrintDocument中
打印
但是当我尝试删除该文件之前,我再次运行该程序,它告诉我,它不能删除该文件,因为它使用由应用程序本身,如果出版)或vshost32- clr2.exe(在调试时)。
我曾尝试:
处置PrintDocument类
处置,关闭并重新打开窗体本身。
以上都不对我有帮助。
寻找一个好主意(其他然后创建创建每个标签不同的图像)
感谢, 盖伊
“条码”是否可以一次性使用? – pinkfloydx33
不,找了它,找不到任何方式来处理它 – RobinHud
什么是FileToUse?它是一个字符串还是一个流 – pinkfloydx33