VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form Form1 
   Caption         =   "二维条码生成演示"
   ClientHeight    =   6000
   ClientLeft      =   7665
   ClientTop       =   5880
   ClientWidth     =   4575
   LinkTopic       =   "Form1"
   ScaleHeight     =   6000
   ScaleWidth      =   4575
   StartUpPosition =   2  'CenterScreen
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   240
      Top             =   4560
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton Command3 
      Caption         =   "保存"
      Height          =   375
      Left            =   3120
      TabIndex        =   29
      Top             =   5400
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "从文件生成"
      Height          =   375
      Left            =   1680
      TabIndex        =   28
      Top             =   5400
      Width           =   1095
   End
   Begin VB.Frame Frame2 
      Caption         =   "文字"
      Height          =   1695
      Left            =   120
      TabIndex        =   11
      Top             =   2280
      Width           =   4335
      Begin VB.TextBox Text10 
         Height          =   270
         Left            =   2880
         TabIndex        =   23
         Text            =   "10"
         Top             =   1320
         Width           =   975
      End
      Begin VB.TextBox Text9 
         Height          =   270
         Left            =   960
         TabIndex        =   22
         Text            =   "10"
         Top             =   1320
         Width           =   975
      End
      Begin VB.TextBox Text8 
         Height          =   270
         Left            =   2880
         TabIndex        =   21
         Text            =   "10"
         Top             =   960
         Width           =   975
      End
      Begin VB.TextBox Text7 
         Height          =   270
         Left            =   960
         TabIndex        =   20
         Text            =   "0"
         Top             =   960
         Width           =   975
      End
      Begin VB.TextBox Text6 
         Height          =   270
         Left            =   960
         TabIndex        =   19
         Text            =   "123456789"
         Top             =   600
         Width           =   2895
      End
      Begin VB.TextBox Text5 
         Height          =   270
         Left            =   960
         TabIndex        =   13
         Text            =   "9"
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label Label11 
         Caption         =   "垂直留白"
         Height          =   375
         Left            =   2040
         TabIndex        =   18
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label10 
         Caption         =   "文字高度"
         Height          =   255
         Left            =   2040
         TabIndex        =   17
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label9 
         Caption         =   "水平留白"
         Height          =   255
         Left            =   120
         TabIndex        =   16
         Top             =   1320
         Width           =   735
      End
      Begin VB.Label Label8 
         Caption         =   "字体大小"
         Height          =   375
         Left            =   120
         TabIndex        =   15
         Top             =   960
         Width           =   855
      End
      Begin VB.Label Label7 
         Caption         =   "文字信息"
         Height          =   255
         Left            =   120
         TabIndex        =   14
         Top             =   600
         Width           =   735
      End
      Begin VB.Label Label6 
         Caption         =   "每行字数"
         Height          =   255
         Left            =   120
         TabIndex        =   12
         Top             =   240
         Width           =   735
      End
   End
   Begin VB.Frame Frame1 
      Height          =   2055
      Left            =   120
      TabIndex        =   2
      Top             =   120
      Width           =   4335
      Begin VB.TextBox Text12 
         Height          =   270
         Left            =   2400
         TabIndex        =   27
         Text            =   "0"
         Top             =   1680
         Width           =   375
      End
      Begin VB.TextBox Text11 
         Height          =   270
         Left            =   1080
         TabIndex        =   25
         Text            =   "2"
         Top             =   1680
         Width           =   375
      End
      Begin VB.TextBox Text4 
         Height          =   285
         Left            =   3600
         TabIndex        =   9
         Text            =   "3"
         Top             =   1200
         Width           =   375
      End
      Begin VB.TextBox Text3 
         Height          =   285
         Left            =   2400
         TabIndex        =   7
         Text            =   "3"
         Top             =   1200
         Width           =   375
      End
      Begin VB.TextBox Text2 
         Height          =   285
         Left            =   1080
         TabIndex        =   5
         Text            =   "7"
         Top             =   1200
         Width           =   375
      End
      Begin VB.TextBox Text1 
         Height          =   765
         Left            =   840
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   3
         Text            =   "Form1.frx":0000
         Top             =   240
         Width           =   2895
      End
      Begin VB.Label Label13 
         Caption         =   "颜色"
         Height          =   255
         Left            =   2040
         TabIndex        =   26
         Top             =   1680
         Width           =   495
      End
      Begin VB.Label Label12 
         Caption         =   "高度"
         Height          =   255
         Left            =   720
         TabIndex        =   24
         Top             =   1680
         Width           =   495
      End
      Begin VB.Label Label5 
         Caption         =   "长宽比"
         Height          =   255
         Left            =   3000
         TabIndex        =   10
         Top             =   1200
         Width           =   615
      End
      Begin VB.Label Label4 
         Caption         =   "纠错等级"
         Height          =   255
         Left            =   1680
         TabIndex        =   8
         Top             =   1200
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "条码列数"
         Height          =   255
         Left            =   360
         TabIndex        =   6
         Top             =   1200
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "数据"
         Height          =   255
         Left            =   360
         TabIndex        =   4
         Top             =   360
         Width           =   495
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "生成"
      Height          =   375
      Left            =   120
      Picture         =   "Form1.frx":0007
      TabIndex        =   0
      Top             =   5400
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "条码"
      Height          =   255
      Left            =   360
      TabIndex        =   1
      Top             =   4200
      Width           =   375
   End
   Begin VB.Image Image1 
      BorderStyle     =   1  'Fixed Single
      Height          =   945
      Left            =   1080
      Stretch         =   -1  'True
      Top             =   4200
      Width           =   3360
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Private Declare Sub MakeString Lib "MakePdf417.dll" _
'(ucData As Byte, ByVal nLen As Long, ByVal szFileName As String, ByVal nClumn As Long, ByVal nErr As Long, ByVal nHLRatio As Long)
Private Sub Command1_Click()
Dim barcode As New MAKEPDF417Lib.BarCodePDF417
Dim a() As Byte
a = StrConv(Text1.Text, vbFromUnicode)
barcode.SetColorDepth (Text5.Text)
barcode.MakeString a, "abc.bmp", CLng(Text2.Text), CLng(Text3.Text), CLng(Text4.Text), CLng(Text11.Text)
barcode.GetColorDepth
barcode.MixText ("abc.bmp"), ("abc.bmp"), CLng(Text6.Text), _
     CLng(Text7.Text), _
     CLng(Text8.Text), _
     CLng(Text9.Text), _
     CLng(Text10.Text), _
     CLng(Text5.Text)
Image1.Picture = LoadPicture("abc.bmp")
    End Sub

Private Sub Command2_Click()
Dim barcode As New MAKEPDF417Lib.BarCodePDF417
CommonDialog1.Action = 1
FileName = CommonDialog1.FileName
If FileName = "" Then
Exit Sub
End If
Dim a() As Byte
a = StrConv(FileName, vbFromUnicode)
barcode.SetColorDepth (Text5.Text)
barcode.MakeString a, "abc.bmp", CLng(Text2.Text), CLng(Text3.Text), CLng(Text4.Text), CLng(Text11.Text)
barcode.GetColorDepth
barcode.MixText ("abc.bmp"), ("abc.bmp"), CLng(Text6.Text), _
     CLng(Text7.Text), _
     CLng(Text8.Text), _
     CLng(Text9.Text), _
     CLng(Text10.Text), _
     CLng(Text5.Text)
Image1.Picture = LoadPicture("abc.bmp")
End Sub

Private Sub Command3_Click()
CommonDialog1.InitDir = ""
CommonDialog1.Filter = "位图文件 (*.bmp)|*.bmp|所有文件 (*.*)|*.*||"
CommonDialog1.FileName = "twobarcode.bmp"
CommonDialog1.ShowSave
Open CommonDialog1.FileName For Output As #1
Print #1, Image
Close 1

End Sub
