H
hfjacklee
Unregistered / Unconfirmed
GUEST, unregistred user!
这是一个关于斑马条码打印机函数的声明:
Function in FNTHEX.DLL:
* GETFONTHEX() - Get bitmap in hex code of specific out
* string and font to buffer.
* Parameter:
* 1) LPSTR outStr, // output string
* 2) LPSTR lfFaceName, // Windows font name
* 3) LPSTR outstrname // output string name
* 4) short int lfOrientation, // clock-wish Orientation: 0,90,180,270
* 5) short int lfHeight, // font height
* 6) short int lfWidth, // font width, always set to 0
* 7) short int lfBold, // bold font style
* 8) short int lfItalic, // italic font style
* 9) LPSTR hexBuf // buffer to receive hex codes,
* size must set to 21K.
* Return : Byte count of buffer contents if successful, otherwise <= 0
*
* Note : 1) Before program to call function GETFONTHEX() in FNTHEX32.DLL,
* Statement must be added to declare it in the call program.
* 2) Function name GETFONTHEX() must in upper case.
* 3) Before function GETFONTHEX() is called, the buffer that is equal
* to 21K must to allocate first.
* 4) The return of GETFONTHEX() is greate than 0 if function call is
* successful, and result of Chinese data is stored in 21K buffer.
* The total number of byte output in buffer is return by GETNFONTHEX().
* 5) Printer driver "Generic / Text Only" must be set for
* label printing under Windows 32 bit environment.
这是在vb中的例子
Private Declare Function GETFONTHEX Lib "fnthex32.dll" (ByVal chnstr$, ByVal fontname$, ByVal chnname$, ByVal orient%, ByVal height%, ByVal width%, _
ByVal bold%, ByVal italic%, ByVal hexbuf$) As Integer
Private Sub Command1_Click()
Dim MAX_BUFFER As Integer, nCount As Integer
Dim cBuf As String * 21000
Dim I As Integer
nCount = GETFONTHEX("钙奶片", "宋体", "chnstr01", 0, 50, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
nCount = GETFONTHEX("金额(¥)", "宋体", "chnstr02", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
nCount = GETFONTHEX("三联商业公司", "宋体", "chnstr03", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
nCount = GETFONTHEX("银座超市", "宋体", "chnstr04", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
Printer.Print "^XA^LH10,10"
Printer.Print "^FO100,20^XGchnstr01,1,1^FS"
Printer.Print "^FO20,100^BEN,60,Y,N^FD123456789012^FS"
Printer.Print "^FO50,200^XGchnstr02,1,1^FS"
Printer.Print "^FO250,200^A040,40^FD2.20^FS"
Printer.Print "^FO50,250^XGchnstr03,1,1^FS"
Printer.Print "^FO50,300^XGchnstr04,1,1^FS"
Printer.Print "^PQ1^FS"
Printer.Print "^XZ"
Printer.EndDoc
可是我怎么都无法转换到delphi中来。急啊!!!(分不多了)
Function in FNTHEX.DLL:
* GETFONTHEX() - Get bitmap in hex code of specific out
* string and font to buffer.
* Parameter:
* 1) LPSTR outStr, // output string
* 2) LPSTR lfFaceName, // Windows font name
* 3) LPSTR outstrname // output string name
* 4) short int lfOrientation, // clock-wish Orientation: 0,90,180,270
* 5) short int lfHeight, // font height
* 6) short int lfWidth, // font width, always set to 0
* 7) short int lfBold, // bold font style
* 8) short int lfItalic, // italic font style
* 9) LPSTR hexBuf // buffer to receive hex codes,
* size must set to 21K.
* Return : Byte count of buffer contents if successful, otherwise <= 0
*
* Note : 1) Before program to call function GETFONTHEX() in FNTHEX32.DLL,
* Statement must be added to declare it in the call program.
* 2) Function name GETFONTHEX() must in upper case.
* 3) Before function GETFONTHEX() is called, the buffer that is equal
* to 21K must to allocate first.
* 4) The return of GETFONTHEX() is greate than 0 if function call is
* successful, and result of Chinese data is stored in 21K buffer.
* The total number of byte output in buffer is return by GETNFONTHEX().
* 5) Printer driver "Generic / Text Only" must be set for
* label printing under Windows 32 bit environment.
这是在vb中的例子
Private Declare Function GETFONTHEX Lib "fnthex32.dll" (ByVal chnstr$, ByVal fontname$, ByVal chnname$, ByVal orient%, ByVal height%, ByVal width%, _
ByVal bold%, ByVal italic%, ByVal hexbuf$) As Integer
Private Sub Command1_Click()
Dim MAX_BUFFER As Integer, nCount As Integer
Dim cBuf As String * 21000
Dim I As Integer
nCount = GETFONTHEX("钙奶片", "宋体", "chnstr01", 0, 50, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
nCount = GETFONTHEX("金额(¥)", "宋体", "chnstr02", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
nCount = GETFONTHEX("三联商业公司", "宋体", "chnstr03", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
nCount = GETFONTHEX("银座超市", "宋体", "chnstr04", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
Printer.Print "^XA^LH10,10"
Printer.Print "^FO100,20^XGchnstr01,1,1^FS"
Printer.Print "^FO20,100^BEN,60,Y,N^FD123456789012^FS"
Printer.Print "^FO50,200^XGchnstr02,1,1^FS"
Printer.Print "^FO250,200^A040,40^FD2.20^FS"
Printer.Print "^FO50,250^XGchnstr03,1,1^FS"
Printer.Print "^FO50,300^XGchnstr04,1,1^FS"
Printer.Print "^PQ1^FS"
Printer.Print "^XZ"
Printer.EndDoc
可是我怎么都无法转换到delphi中来。急啊!!!(分不多了)