Can';t在VB.NET中打印后删除aBarcode图像(KeepAutomation)
我正在建立一个标签打印机与代码128条码与KeepAutomation 在这个过程中,我实际上:Can';t在VB.NET中打印后删除aBarcode图像(KeepAutomation),vb.net,Vb.net,我正在建立一个标签打印机与代码128条码与KeepAutomation 在这个过程中,我实际上: 使用KeepAutomation引用模块将数据编码为条形码 Private Sub MakeImage() Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode barcode.Symbology = KeepAutomation.Barcode.Symbology.C
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)
MakeImage()
Dim fs As New FileStream(FileToUse, FileMode.Open, FileAccess.Read)
e.Graphics.DrawImage(Image.FromStream(fs), 20, 5, 150, 80)
e.Graphics.DrawString("Batch: ___________", BatchFont, Brushes.Black, 0, 97)
fs.Dispose()
结论,如果可以的话
无论何时打开文件,尤其是不需要修改文件时,请以FS方式访问文件并以只读方式打开
再次感谢。条形码是一次性的吗?不,也找过了,找不到任何处理方法。什么是文件?它是一个字符串还是一个streamFileToUse是一个简单的字符串,包含指向文件夹中applicationIn的相对路径:“.\FileName.jpg”这可能导致锁定<代码>条形码。generateBarcodeToImageFile(FileToUse)您可以在临时文件夹中创建一个带有随机文件名的临时文件,创建文件后,将其复制到FileToUse。然后,当应用程序打开时,清除tempoary文件夹。因为您无法更改KeepAutomation API