Private Declare Sub SetColorDepth Lib "MakePDF417.dll" (ByRef nDepth As Integer)
Private Declare Sub GetColorDepth Lib "MakePDF417.dll" ()
Private Declare Sub MixText Lib "MakePDF417.dll" (ByVal szSrcBmpFileName As String, ByVal szDstBmpFileName As String, ByVal szText As String, ByVal lFontSize As Integer, ByVal lTxtHeight As Integer, ByVal lHmargin As Integer, ByVal lVmargin As Integer, ByVal lTxtCntOneLine As Integer)
Private Declare Sub Make Lib "MakePDF417.dll" (ByRef ucData As Byte, ByVal nLen As Integer, ByVal szFileName As String, ByVal nClumn As Integer, ByVal nErr As Integer, ByVal nHLRatio As Integer, ByVal nHeight As Integer)
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim a() As Byte
a = System.Text.UnicodeEncoding.Unicode.GetBytes(StrConv(TextBox1.Text, VbStrConv.None))
Make(a(2), UBound(a) - LBound(a) + 1, "tmp.bmp", CInt(TextBox2.Text), CInt(TextBox3.Text), CInt(TextBox4.Text), CInt(TextBox6.Text))
SetColorDepth(CInt(TextBox5.Text))
GetColorDepth()
Dim tmp, tmp2 As Bitmap
tmp = Image.FromFile(Application.StartupPath & "\tmp.bmp")
tmp2 = New Bitmap(tmp)
tmp.Dispose()
PictureBox1.Image = tmp2
End Sub
1