You are on page 1of 12

Make your programs run on Windows startup

The two best methods for automatically launching a program at startup are to use
the registry or the system's Startup folder. Which method you choose depends on
how easy you want to make it for the user to remove the program if he or she de
cides that it shouldn't run at system startup. Using the Startup folder gives th
e user more control; to prevent the program from running at startup, the user ju
st has to remove its shortcut from the folder. Using the registry makes it less
accessible; the user will have to be familiar with the structure of the registry
and will have to know how to use an editing tool like RegEdit in order to preve
nt the application from running at startup.
Sample Code.
'Write to register
Dim regKey As Microsoft.Win32.RegistryKeyregKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVer
sion\Run", True)
regKey.SetValue("YourApplicationName", "YourInstallPath")
regKey.Close()
If you want to remove from register use this code.
regKey.DeleteValue("YourApplicationName", False)
Barcode generation and printing
Visual Studio Languages forums
,
.NET Framework forums
>
Visual Basic
Question
Question
Sign in to vote
0
Sign in to vote
I am working on a Point of Sale system using VB express 2008.
I want to generate invoice with Barcode and also stock items with Barcode.
Please advise what sort of Barcode system i should use for this and also how
i can code to generate and pring the Barcode.
Saturday, December 12, 2009 2:03 AM
Reply
|
Quote
|
Avatar of sazd1
sazd1
25 Points
Answers
Question
Sign in to vote
0
Sign in to vote
Thanks Kmaf. I downloaded the font from the site:
http://www.fontspace.com/i-shot-the-serif/free-3-of-9
I visited the sites of Codeproject and the samples there are for C langu
age.
Please suggest some sample code for VB.net.
Thanks again for your guidance.
If you want to use the font, there is no need to use the barcode library. Al
l you have to do is to create a code using graphics class in .net to create imag
e and use the 3 of 9 font to draw the text on the image. Copy the font in font d
irectory "C:\WINDOWS\Fonts\" . Make sure you download the free 3 of 9 extended b
ecause it accept more characters than 3 of 9 regular. Try the code below
Function createBarCodeSimple(ByVal info As String) As Drawing.Bitmap
Dim k As String = info
Dim stchar As String = String.Empty
Dim addStar As String = "*"
Dim full As String = addStar & info & addStar
info = full
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(1, 1)
'Dim myf As Font = New Font("Arial", 12, FontStyle.Regular) ', Graph
icsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", 60
, Drawing.FontStyle.Regular, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
Dim infoSize As Drawing.SizeF = g.MeasureString(info, ft)
bc = New Drawing.Bitmap(bc, infoSize.ToSize)
g = Drawing.Graphics.FromImage(bc)
g.Clear(Drawing.Color.White)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
For Each chr As Char In info
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, ft, New Drawing.SolidBrush(Drawing.Color.Black)
, 2, 3)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
kaymaf
If that what you want, take it. If not, ignored it and no complain
Marked as answer by sazd1 Sunday, December 13, 2009 2:58 AM
Saturday, December 12, 2009 3:30 PM
Reply
|
Quote
|
Avatar of kaymaf
kaymaf
44,275 Points
Question
Sign in to vote
0
Sign in to vote
If you want to print the barcode text with the image, then try the methods b
elow. I made different method with description and logo image.
Function createBarCodeNoDescription(ByVal BarcodeNumber As String, ByVal Ba
rcodeColor As Drawing.Color, ByVal BarcodeSize As Integer, ByVal AddBackGroundCo
lor As Boolean) As Drawing.Bitmap
Dim stchar As String = String.Empty
Dim col1 As Drawing.Color = BarcodeColor
Dim col2 As Drawing.Color = BarcodeColor
Dim k As String = BarcodeNumber
Dim addStar As String = "*"
Dim full As String = addStar & BarcodeNumber & addStar
BarcodeNumber = full
Dim textsize As Drawing.SizeF
Dim int As Integer = BarcodeSize / 2
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(BarcodeSize * 8, Barco
deSize * 2)
Dim myf As Drawing.Font = New Drawing.Font("Arial", int, New Drawing
.FontStyle) ', GraphicsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", Ba
rcodeSize, New Drawing.FontStyle, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
textsize = g.MeasureString(BarcodeNumber, myf)
If AddBackGroundColor = True Then
g.Clear(Drawing.Color.White)
End If
' g.Clear(Panel1.BackColor)
' g.Clear(Color.Transparent)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
g.DrawString(BarcodeNumber, ft, New Drawing.SolidBrush(col1), 2, 3)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
For Each chr As Char In k
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, myf, New Drawing.SolidBrush(col2), 6, textsize.
Height + 6)
' g.DrawString(k, myf, New SolidBrush(Color.Black), 0, 30)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
Function createBarCodeSimple(ByVal info As String) As Drawing.Bitmap
Dim k As String = info
Dim stchar As String = String.Empty
Dim addStar As String = "*"
Dim full As String = addStar & info & addStar
info = full
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(1, 1)
'Dim myf As Font = New Font("Arial", 12, FontStyle.Regular) ', Graph
icsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", 60
, Drawing.FontStyle.Regular, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
Dim infoSize As Drawing.SizeF = g.MeasureString(info, ft)
bc = New Drawing.Bitmap(bc, infoSize.ToSize)
g = Drawing.Graphics.FromImage(bc)
g.Clear(Drawing.Color.White)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
For Each chr As Char In info
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, ft, New Drawing.SolidBrush(Drawing.Color.Black)
, 2, 3)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
Function createBarCodeWithDescription(ByVal barcodeDescription As String
, ByVal BarcodeNumber As String, ByVal BarcodeColor As Drawing.Color, ByVal Barc
odeSize As Integer, ByVal AddBackGroundColor As Boolean) As Drawing.Bitmap
Dim textsize As Drawing.SizeF
Dim stchar As String = String.Empty
Dim textsize2 As Drawing.SizeF
Dim col1 As Drawing.Color = BarcodeColor
Dim col2 As Drawing.Color = BarcodeColor
Dim k As String = BarcodeNumber
Dim addStar As String = "*"
Dim full As String = addStar & BarcodeNumber & addStar
BarcodeNumber = full
Dim int As Integer = BarcodeSize / 2
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(BarcodeSize * 8, Barco
deSize * 3)
Dim myf As Drawing.Font = New Drawing.Font("Arial", int, New Drawing
.FontStyle) ', GraphicsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", Ba
rcodeSize, New Drawing.FontStyle, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
If AddBackGroundColor = True Then
g.Clear(Drawing.Color.White)
End If
textsize = g.MeasureString(barcodeDescription, myf)
textsize2 = g.MeasureString(BarcodeNumber, myf)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
g.DrawString(barcodeDescription, myf, New Drawing.SolidBrush(col2),
2, 0)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
g.DrawString(BarcodeNumber, ft, New Drawing.SolidBrush(col1), 2, tex
tsize.Height + 2)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
For Each chr As Char In k
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, myf, New Drawing.SolidBrush(col2), 6, textsize.
Height + textsize2.Height + 6)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
Function createBarCodeWithDescriptionAndLogoImage(ByVal img As Drawing.B
itmap, ByVal barcodeDescription As String, ByVal BarcodeNumber As String, ByVal
BarcodeColor As Drawing.Color, ByVal BarcodeSize As Integer, ByVal AddBackGround
Color As Boolean) As Drawing.Bitmap
Dim textsize As Drawing.SizeF
Dim stchar As String = String.Empty
Dim textsize2 As Drawing.SizeF
Dim col1 As Drawing.Color = BarcodeColor
Dim col2 As Drawing.Color = BarcodeColor
Dim k As String = BarcodeNumber
Dim addStar As String = "*"
Dim full As String = addStar & BarcodeNumber & addStar
BarcodeNumber = full
Dim int As Integer = BarcodeSize / 2
img = New Drawing.Bitmap(img, New Drawing.Size(((img.Size.Width - im
g.Size.Width) + int), ((img.Size.Height - img.Size.Height) + int)))
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(BarcodeSize * 8, Barco
deSize * 3)
Dim myf As Drawing.Font = New Drawing.Font("Arial", int, New Drawing
.FontStyle) ', GraphicsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", Ba
rcodeSize, New Drawing.FontStyle, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
If AddBackGroundColor = True Then
g.Clear(Drawing.Color.White)
End If
g.DrawImage(img, 2, 0)
textsize = g.MeasureString(barcodeDescription, myf)
textsize2 = g.MeasureString(BarcodeNumber, myf)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
g.DrawString(barcodeDescription, myf, New Drawing.SolidBrush(col2),
img.Width + 5, 0)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
g.DrawString(BarcodeNumber, ft, New Drawing.SolidBrush(col1), 2, tex
tsize.Height + 3)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
For Each chr As Char In k
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, myf, New Drawing.SolidBrush(col2), 6, textsize.
Height + textsize2.Height + 8)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
And for the second part of your question, to read barcode from image, you ha
ve to know how the barcode symbologies encoding algorithm. Try this link http://
www.codeproject.com/KB/graphics/barcodeImaging.aspx
The class library was C# code. Don't even bother to convert it to VB.NET bec
ause it use some unsafe code. What you can do, just download the source code and
compile the barcode class to .net dll then you can reference it in your vb prog
ram. The library covered code39,code128, EAN/UPC. You only needs to use code39 w
hich is for Font free3of9
kaymafIf that what you want, take it. If not, ignored it and no complain
Marked as answer by sazd1 Monday, December 14, 2009 11:02 AM
Sunday, December 13, 2009 3:21 AM
Reply
|
Quote
|
Avatar of kaymaf
kaymaf
44,275 Points
All replies
Question
Sign in to vote
0
Sign in to vote
There are many type of barcode symbology that you can use. Standard retail b
arcode are UPCA, UPCE but for stock item, use CODE39 or CODE39 Extended because
it accept alphanumeric value, and the extended accept all keyboard characters.
You can google for free font, the name is free 3 of 9 extended regular and file
name is FRE3OF9X.TTF (true font). Also, you can generate the same barcode with
out font using GDI+ to draw the bar based on encoding.
Barcode code39 example article: http://www.codeproject.com/KB/miscctrl/barco
dectl.aspx
: http://www.codeproject.com/K
B/graphics/BarcodeLibrary.aspx
Read about barcode symbologies http://en.wikipedia.org/wiki/Barcode
kaymafIf that what you want, take it. If not, ignored it and no complain
Saturday, December 12, 2009 3:27 AM
Reply
|
Quote
|
Avatar of kaymaf
kaymaf
44,275 Points
Question
Sign in to vote
0
Sign in to vote
Thanks Kmaf. I downloaded the font from the site:
http://www.fontspace.com/i-shot-the-serif/free-3-of-9
I visited the sites of Codeproject and the samples there are for C language.
Please suggest some sample code for VB.net.
Thanks again for your guidance.
Saturday, December 12, 2009 11:04 AM
Reply
|
Quote
|
Avatar of sazd1
sazd1
25 Points
Question
Sign in to vote
0
Sign in to vote
You can convert C# to VB here:
http://www.developerfusion.com/tools/convert/csharp-to-vb/
Saturday, December 12, 2009 11:18 AM
Reply
|
Quote
|
Avatar of Acamar
Acamar
73,690 Points
Question
Sign in to vote
0
Sign in to vote
Thanks Kmaf. I downloaded the font from the site:
http://www.fontspace.com/i-shot-the-serif/free-3-of-9
I visited the sites of Codeproject and the samples there are for C langu
age.
Please suggest some sample code for VB.net.
Thanks again for your guidance.
If you want to use the font, there is no need to use the barcode library. Al
l you have to do is to create a code using graphics class in .net to create imag
e and use the 3 of 9 font to draw the text on the image. Copy the font in font d
irectory "C:\WINDOWS\Fonts\" . Make sure you download the free 3 of 9 extended b
ecause it accept more characters than 3 of 9 regular. Try the code below
Function createBarCodeSimple(ByVal info As String) As Drawing.Bitmap
Dim k As String = info
Dim stchar As String = String.Empty
Dim addStar As String = "*"
Dim full As String = addStar & info & addStar
info = full
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(1, 1)
'Dim myf As Font = New Font("Arial", 12, FontStyle.Regular) ', Graph
icsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", 60
, Drawing.FontStyle.Regular, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
Dim infoSize As Drawing.SizeF = g.MeasureString(info, ft)
bc = New Drawing.Bitmap(bc, infoSize.ToSize)
g = Drawing.Graphics.FromImage(bc)
g.Clear(Drawing.Color.White)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
For Each chr As Char In info
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, ft, New Drawing.SolidBrush(Drawing.Color.Black)
, 2, 3)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
kaymaf
If that what you want, take it. If not, ignored it and no complain
Marked as answer by sazd1 Sunday, December 13, 2009 2:58 AM
Saturday, December 12, 2009 3:30 PM
Reply
|
Quote
|
Avatar of kaymaf
kaymaf
44,275 Points
Question
Sign in to vote
0
Sign in to vote
Thanks Kaymaf it worked like a charm and it was good to see code creation th
rough Vb express 2008.
I am using a Textbox for input of code and a picturebox to display the Barco
de as under:
PictureBox1.Image = createBarCodeSimple(txtEAN.Text)

I have two more queiries related to barcode.
How can i display the code entered in Textbox under the barcode in picturebo
x.
And how I can verify that the barcode is of the same code i.e. how i can rev
erse converting the barcode displayed in picturebox back to code.
Thanks once again for all your guidance.

Sunday, December 13, 2009 2:58 AM
Reply
|
Quote
|
Avatar of sazd1
sazd1
25 Points
Question
Sign in to vote
0
Sign in to vote
If you want to print the barcode text with the image, then try the methods b
elow. I made different method with description and logo image.
Function createBarCodeNoDescription(ByVal BarcodeNumber As String, ByVal Ba
rcodeColor As Drawing.Color, ByVal BarcodeSize As Integer, ByVal AddBackGroundCo
lor As Boolean) As Drawing.Bitmap
Dim stchar As String = String.Empty
Dim col1 As Drawing.Color = BarcodeColor
Dim col2 As Drawing.Color = BarcodeColor
Dim k As String = BarcodeNumber
Dim addStar As String = "*"
Dim full As String = addStar & BarcodeNumber & addStar
BarcodeNumber = full
Dim textsize As Drawing.SizeF
Dim int As Integer = BarcodeSize / 2
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(BarcodeSize * 8, Barco
deSize * 2)
Dim myf As Drawing.Font = New Drawing.Font("Arial", int, New Drawing
.FontStyle) ', GraphicsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", Ba
rcodeSize, New Drawing.FontStyle, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
textsize = g.MeasureString(BarcodeNumber, myf)
If AddBackGroundColor = True Then
g.Clear(Drawing.Color.White)
End If
' g.Clear(Panel1.BackColor)
' g.Clear(Color.Transparent)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
g.DrawString(BarcodeNumber, ft, New Drawing.SolidBrush(col1), 2, 3)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
For Each chr As Char In k
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, myf, New Drawing.SolidBrush(col2), 6, textsize.
Height + 6)
' g.DrawString(k, myf, New SolidBrush(Color.Black), 0, 30)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
Function createBarCodeSimple(ByVal info As String) As Drawing.Bitmap
Dim k As String = info
Dim stchar As String = String.Empty
Dim addStar As String = "*"
Dim full As String = addStar & info & addStar
info = full
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(1, 1)
'Dim myf As Font = New Font("Arial", 12, FontStyle.Regular) ', Graph
icsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", 60
, Drawing.FontStyle.Regular, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
Dim infoSize As Drawing.SizeF = g.MeasureString(info, ft)
bc = New Drawing.Bitmap(bc, infoSize.ToSize)
g = Drawing.Graphics.FromImage(bc)
g.Clear(Drawing.Color.White)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
For Each chr As Char In info
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, ft, New Drawing.SolidBrush(Drawing.Color.Black)
, 2, 3)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
Function createBarCodeWithDescription(ByVal barcodeDescription As String
, ByVal BarcodeNumber As String, ByVal BarcodeColor As Drawing.Color, ByVal Barc
odeSize As Integer, ByVal AddBackGroundColor As Boolean) As Drawing.Bitmap
Dim textsize As Drawing.SizeF
Dim stchar As String = String.Empty
Dim textsize2 As Drawing.SizeF
Dim col1 As Drawing.Color = BarcodeColor
Dim col2 As Drawing.Color = BarcodeColor
Dim k As String = BarcodeNumber
Dim addStar As String = "*"
Dim full As String = addStar & BarcodeNumber & addStar
BarcodeNumber = full
Dim int As Integer = BarcodeSize / 2
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(BarcodeSize * 8, Barco
deSize * 3)
Dim myf As Drawing.Font = New Drawing.Font("Arial", int, New Drawing
.FontStyle) ', GraphicsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", Ba
rcodeSize, New Drawing.FontStyle, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
If AddBackGroundColor = True Then
g.Clear(Drawing.Color.White)
End If
textsize = g.MeasureString(barcodeDescription, myf)
textsize2 = g.MeasureString(BarcodeNumber, myf)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
g.DrawString(barcodeDescription, myf, New Drawing.SolidBrush(col2),
2, 0)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
g.DrawString(BarcodeNumber, ft, New Drawing.SolidBrush(col1), 2, tex
tsize.Height + 2)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
For Each chr As Char In k
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, myf, New Drawing.SolidBrush(col2), 6, textsize.
Height + textsize2.Height + 6)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
Function createBarCodeWithDescriptionAndLogoImage(ByVal img As Drawing.B
itmap, ByVal barcodeDescription As String, ByVal BarcodeNumber As String, ByVal
BarcodeColor As Drawing.Color, ByVal BarcodeSize As Integer, ByVal AddBackGround
Color As Boolean) As Drawing.Bitmap
Dim textsize As Drawing.SizeF
Dim stchar As String = String.Empty
Dim textsize2 As Drawing.SizeF
Dim col1 As Drawing.Color = BarcodeColor
Dim col2 As Drawing.Color = BarcodeColor
Dim k As String = BarcodeNumber
Dim addStar As String = "*"
Dim full As String = addStar & BarcodeNumber & addStar
BarcodeNumber = full
Dim int As Integer = BarcodeSize / 2
img = New Drawing.Bitmap(img, New Drawing.Size(((img.Size.Width - im
g.Size.Width) + int), ((img.Size.Height - img.Size.Height) + int)))
Dim bc As Drawing.Bitmap = New Drawing.Bitmap(BarcodeSize * 8, Barco
deSize * 3)
Dim myf As Drawing.Font = New Drawing.Font("Arial", int, New Drawing
.FontStyle) ', GraphicsUnit.Point)
Dim ft As Drawing.Font = New Drawing.Font("Free 3 of 9 Extended", Ba
rcodeSize, New Drawing.FontStyle, Drawing.GraphicsUnit.Point)
Dim g As Drawing.Graphics = Drawing.Graphics.FromImage(bc)
If AddBackGroundColor = True Then
g.Clear(Drawing.Color.White)
End If
g.DrawImage(img, 2, 0)
textsize = g.MeasureString(barcodeDescription, myf)
textsize2 = g.MeasureString(BarcodeNumber, myf)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
g.DrawString(barcodeDescription, myf, New Drawing.SolidBrush(col2),
img.Width + 5, 0)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPix
el '
g.DrawString(BarcodeNumber, ft, New Drawing.SolidBrush(col1), 2, tex
tsize.Height + 3)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.SystemDefault
For Each chr As Char In k
stchar &= chr.ToString & " "
Next
g.DrawString(stchar, myf, New Drawing.SolidBrush(col2), 6, textsize.
Height + textsize2.Height + 8)
g.Flush()
ft.Dispose()
g.Dispose()
Return bc
End Function
And for the second part of your question, to read barcode from image, you ha
ve to know how the barcode symbologies encoding algorithm. Try this link http://
www.codeproject.com/KB/graphics/barcodeImaging.aspx
The class library was C# code. Don't even bother to convert it to VB.NET bec
ause it use some unsafe code. What you can do, just download the source code and
compile the barcode class to .net dll then you can reference it in your vb prog
ram. The library covered code39,code128, EAN/UPC. You only needs to use code39 w
hich is for Font free3of9
kaymafIf that what you want, take it. If not, ignored it and no complain
Marked as answer by sazd1 Monday, December 14, 2009 11:02 AM
Sunday, December 13, 2009 3:21 AM
Reply
|
Quote
|
Avatar of kaymaf
kaymaf
44,275 Points
Question
Sign in to vote
0
Sign in to vote
Hi Kaymaf
Thanks so much for all of your guidance, help and explaining the things with
code. I am sure this thread will help all other newbees like me.
Thanks again for your support.
Monday, December 14, 2009 11:03 AM
Reply
|
Quote
|
Avatar of sazd1
sazd1
25 Points
Question
Sign in to vote
0
Sign in to vote
Barcode generation and printing is a hot topic in barcode field, as the barc
ode market is developing day by day, there are more and more <a href="http://www
.rasteredge.com/online-barcode-generator/qr-code/">FREE barcode generation</a>an
d printing program which we can use, it is nice.
Edited by ChestertonABCD Wednesday, January 23, 2013 8:12 AM
Wednesday, January 23, 2013 8:06 AM
Reply
|
Quote
|
Avatar of ChestertonABCD
ChestertonABCD
0 Points
Question
Sign in to vote
0
Sign in to vote
There are some sample code for barcode solution with font, check it. http://
www.keepautomation.com/font_tools/source_code_barcode_font_encoder.html
Thursday, May 02, 2013 2:57 AM
Reply
|
Quote
|
Avatar of charleswood
charleswood
0 Points
Question
Sign in to vote
0
Sign in to vote
thank you sir, Actually I use this code to print barcode in crystal report u
sing vb.net 2008 prof. edition and it is worked properly.
thanks again sir.
and i want to know the mechanism of reading barcode from the generated barco
de using the above code.
Edited by BiswajitBhunia Saturday, August 31, 2013 1:42 AM

You might also like