Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Visual Basic Example for PDF417 Encoder SDK/DLL

Visual Basic Example for PDF417 Encoder SDK/DLL 4 years 4 months ago #3892

Private Declare Function PDF417EncodeText2File Lib "PDF417Encodedll.dll" (ByVal pBuf As String, ByVal ImgFile As String, ByVal nRows As Long, ByVal nColumns As Long, ByVal nECLevel As Long, ByVal nModuleWidth As Long, ByVal nModuleHeight As Long, ByVal nMargin As Long, ByVal clFore As Long, ByVal clBack As Long) As Boolean
Private Declare Function PDF417EncodeDigit2File Lib "PDF417Encodedll.dll" (ByVal pBuf As String, ByVal ImgFile As String, ByVal nRows As Long, ByVal nColumns As Long, ByVal nECLevel As Long, ByVal nModuleWidth As Long, ByVal nModuleHeight As Long, ByVal nMargin As Long, ByVal clFore As Long, ByVal clBack As Long) As Boolean
Private Declare Function PDF417EncodeBinary2File Lib "PDF417Encodedll.dll" (ByVal pBuf As String, ByVal nLen As Long, ByVal ImgFile As String, ByVal nRows As Long, ByVal nColumns As Long, ByVal nECLevel As Long, ByVal nModuleWidth As Long, ByVal nModuleHeight As Long, ByVal nMargin As Long, ByVal clFore As Long, ByVal clBack As Long) As Boolean
Private Declare Function PDF417EncodeHybrid2File Lib "PDF417Encodedll.dll" (ByVal pBuf As String, ByVal nLen As Long, ByVal ImgFile As String, ByVal nRows As Long, ByVal nColumns As Long, ByVal nECLevel As Long, ByVal nModuleWidth As Long, ByVal nModuleHeight As Long, ByVal nMargin As Long, ByVal clFore As Long, ByVal clBack As Long) As Boolean

Private Declare Function PDF417EncodeHybrid2Bitmap Lib "PDF417Encodedll.dll" (ByVal pBuf As String, ByVal nLen As Long, ByVal nRows As Long, ByVal nColumns As Long, ByVal nECLevel As Long, ByVal nModuleWidth As Long, ByVal nModuleHeight As Long, ByVal nMargin As Long, ByVal clFore As Long, ByVal clBack As Long) As Long
Private Declare Function PDF417EncodeBinary2Bitmap Lib "PDF417Encodedll.dll" (ByVal pBuf As String, ByVal nLen As Long, ByVal nRows As Long, ByVal nColumns As Long, ByVal nECLevel As Long, ByVal nModuleWidth As Long, ByVal nModuleHeight As Long, ByVal nMargin As Long, ByVal clFore As Long, ByVal clBack As Long) As Long
Private Declare Function PDF417EncodeDigit2Bitmap Lib "PDF417Encodedll.dll" (ByVal pBuf As String, ByVal nRows As Long, ByVal nColumns As Long, ByVal nECLevel As Long, ByVal nModuleWidth As Long, ByVal nModuleHeight As Long, ByVal nMargin As Long, ByVal clFore As Long, ByVal clBack As Long) As Long
Private Declare Function PDF417EncodeText2Bitmap Lib "PDF417Encodedll.dll" (ByVal pBuf As String, ByVal nRows As Long, ByVal nColumns As Long, ByVal nECLevel As Long, ByVal nModuleWidth As Long, ByVal nModuleHeight As Long, ByVal nMargin As Long, ByVal clFore As Long, ByVal clBack As Long) As Long

Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hDC As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hDC As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Sub BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long)


Private Sub Command3_Click()

Dim nRows As Long
Dim nColumns As Long
Dim nModuleWidth As Long
Dim nModuleHeight As Long
Dim nMargin As Long
Dim sData As String
Dim sFile As String


nRows = CLng(edRows.Text)
nColumns = CLng(edColumns.Text)
nModuleWidth = CLng(edModuleWidth.Text)
nModuleHeight = CLng(edModuleHeight.Text)
nMargin = CLng(edMargin.Text)
sData = edData.Text
sFile = edFile.Text
' If PDF417EncodeText2File("sadfdsa", "c:\tt.bmp", 10, 12, 1, 2, 7, 10, 0, &HFFFFFF) Then
If PDF417EncodeText2File("sadfdsa", "c:\tt.bmp", nRows, nColumns, cbECLevel.ListIndex, nModuleWidth, nModuleHeight, nMargin, &H0, &HFFFFFF) Then
Image1.Picture = LoadPicture("c:\tt.bmp")
MsgBox ("success")
End If
End Sub

Private Sub Command4_Click()
Dim hDC As Long
Dim hMap As Long
Dim OldMap As Long
Dim nRows As Long
Dim nColumns As Long
Dim nModuleWidth As Long
Dim nModuleHeight As Long
Dim nMargin As Long
Dim sData As String
Dim sFile As String


nRows = CLng(edRows.Text)
nColumns = CLng(edColumns.Text)
nModuleWidth = CLng(edModuleWidth.Text)
nModuleHeight = CLng(edModuleHeight.Text)
nMargin = CLng(edMargin.Text)
sData = edData.Text
sFile = edFile.Text
hDC = CreateCompatibleDC(Form1.hDC)
hMap = PDF417EncodeText2Bitmap(sData, nRows, nColumns, cbECLevel.ListIndex, nModuleWidth, nModuleHeight, nMargin, &H0, &HFFFFFF)
hOldMap = SelectObject(hDC, hMap)
BitBlt Form1.hDC, 10, 250, 600, 105, hDC, 0, 0, vbSrcCopy
Call SelectObject(hDC, hOldMap)
Call DeleteDC(hDC)
End Sub
The administrator has disabled public write access.

  • Posts:59
  • developer's Avatar
  • developer
  • Moderator
  • OFFLINE
  • Karma: 1
  • Page:
  • 1
Time to create page: 0.181 seconds
Powered by Kunena Forum :: Wibi