欢迎光临条码打印机、条码扫描器、条码软件、条码标签、数据采集器,自动条码识别系统权威集成商Lesain立象条码 !

专注条码技术19年

条码系统应用集成服务提供商

东莞市立象条码制品有限公司



技术咨询
解决方案
联系立象

电 话:13713178909

地 址:广东省东莞市南城区白马黄金路1号天安数码城A1栋1105

传 真:0769-22327189

联系人:张先生
手机:13713178909

邮箱:kent@lesain.com

QQ:398405621

重庆分公司

联系人:李小姐
手机:18102328695

邮箱:aimee@lesain.com

地 址:重庆市南岸区茶园新区玉马路8号中国智能企业园D栋419

条码知识您当前位置:首页 > VB下POSTEK条形码打印机编程函数示例
VB下POSTEK条形码打印机编程函数示例
东莞市立象条码制品有限公司 更新时间:12/27/2009 4:13:28 PM

VB下POSTEK条形码打印机编程函数示例

Option Explicit
Private Declare Function PTK_Getinfo Lib "CDFPSK.DLL" () As Integer
Private Declare Function PTK_SetPrintSpeed Lib "CDFPSK.DLL" (ByVal speed As Integer) As Long
Private Declare Function PTK_SetDarkness Lib "CDFPSK.DLL" (ByVal darkness As Integer) As Long
Private Declare Function PTK_DrawBarcode Lib "CDFPSK.DLL" (ByVal px As Long, ByVal py As Long, ByVal pdirec As Long, ByVal typee As String, ByVal NarrowWidth As Long, ByVal pHorizontal As Long, ByVal pVertical As Long, ByVal ptext As Byte, ByVal pstr As String) As Long
Private Declare Function OpenPort Lib "CDFPSK.DLL" (ByVal OP As Long) As Long
Private Declare Sub ClosePort Lib "CDFPSK.DLL" ()
Private Declare Function PTK_DrawTextTrueTypeW Lib "CDFPSK.DLL" (ByVal x As Long, ByVal y As Long, ByVal FHeight As Long, ByVal FWidth As Long, ByVal FType As String, ByVal Fspin As Long, ByVal FWeight As Long, ByVal FItalic As Long, ByVal FUnline As Long, ByVal FStrikeOut As Long, ByVal id_name As String, ByVal data As String) As Long
Private Declare Function PTK_PcxGraphicsDel Lib "CDFPSK.DLL" (ByVal pid As String) As Long
Private Declare Function PTK_PcxGraphicsDownload Lib "CDFPSK.DLL" (ByVal pcxname As String, ByVal pcxpath As String) As Long
Private Declare Function PTK_PrintLabel Lib "CDFPSK.DLL" (ByVal number As Integer, ByVal cpnumber As Integer) As Long
Private Declare Function PTK_PrintPCX Lib "CDFPSK.DLL" (ByVal px As Integer, ByVal py As Integer, ByVal filename As String) As Long
Private Declare Function PTK_DrawPcxGraphics Lib "CDFPSK.DLL" (ByVal x As Long, ByVal y As Long, ByVal gname As String) As Long
Private Declare Function PTK_DrawLineOr Lib "CDFPSK.DLL" (ByVal px As Integer, ByVal py As Integer, ByVal plength As Integer, ByVal pH As Integer) As Long
Private Declare Function GetErrState Lib "CDFPSK.DLL" () As Integer
Private Declare Function PTK_SetLabelHeight Lib "CDFPSK.DLL" (ByVal lheight As Integer, ByVal gapH As Integer) As Integer
Private Declare Function PTK_SetLabelWidth Lib "CDFPSK.DLL" (ByVal lwidth As Integer) As Integer
Private Declare Function SetPCComPort Lib "CDFPSK.DLL" (ByVal BaudRate As Integer, ByVal HandShake As Boolean) As Integer
Private Declare Function PTK_DrawText Lib "CDFPSK.DLL" (ByVal px As Integer, ByVal py As Integer, ByVal pdirec As Integer, ByVal pFont As Integer, ByVal pHorizontal As Integer, ByVal pVertical As Integer, ByVal ptext As Byte, ByVal pstr As String) As Long
Private Sub Command1_Click()
OpenPort 1
'SetPCComPort 38400, True
PTK_SetDarkness 10
PTK_SetPrintSpeed 4

'PTK_Getinfo (void)
PTK_DrawBarcode 115, 120, 0, "9", 3, 2, 60, 66, "5451T-11-M"
'PTK_DrawBarcode 115, 150, 0, "3C", 2, 4, 60, 66, "236666456"
PTK_PcxGraphicsDel "*"
PTK_PcxGraphicsDownload "aab", "F:\DLL FOR POSTEK\VB TEST\PHONE.PCX" '请更改为PHONE.PCX文件的当前路径
PTK_DrawPcxGraphics 400, 210, "aab"
'PTK_DrawLineOr 50, 180, 2, 100
PTK_DrawTextTrueTypeW 80, 50, 40, 0, "Arial", 1, 400, 0, 0, 0, "AB", "PosteK Printer"
'PTK_DrawText 100, 100, 0, 2, 1, 1, 78, "7777"
'Text1.Text = GetErrState()
PTK_PrintLabel 1, 1
ClosePort
End Sub