29 lines
1.2 KiB
VB.net
29 lines
1.2 KiB
VB.net
Public Class frmBarcodeGenerator
|
|
|
|
Dim cProgramFunctions As New cProgramFunctions
|
|
Private Sub btnGenBar_Click(sender As Object, e As EventArgs) Handles btnGenBar.Click
|
|
' Dim BC As New Barcode
|
|
'pic.Image = BC.GenerateBarcodeImage(800, 140, TextBoxBarcode.Text)
|
|
pic.Image = Code128Rendering.MakeBarcodeImage(TextBoxBarcode.Text, 2, True)
|
|
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
|
|
Dim i As Image = cProgramFunctions.TakeScreenShot(pic)
|
|
' If Not My.Computer.FileSystem.DirectoryExists(My.Computer.FileSystem.SpecialDirectories.Desktop) Then
|
|
'My.Computer.FileSystem.CreateDirectory(My.Computer.FileSystem.SpecialDirectories.Desktop)
|
|
' End If
|
|
|
|
' Dim s As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "\Barcode.png"
|
|
' i.Save(s, Drawing.Imaging.ImageFormat.Png)
|
|
|
|
|
|
Dim s As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "\Barcode.jpeg"
|
|
i.Save(s, Drawing.Imaging.ImageFormat.Jpeg)
|
|
|
|
s = My.Computer.FileSystem.SpecialDirectories.Desktop & "\Barcode.Tiff"
|
|
i.Save(s, Drawing.Imaging.ImageFormat.Tiff)
|
|
|
|
End Sub
|
|
End Class |