Alguem conhece alguma DLL que eu possa usar, que crie uma imagem QR Code ?
QR Code é uma imagem em 2D similar ao código de barrasmas que comporta até set mil e poucos caracteres
Muito Obrigado

Moderador: Moderadores
FUNCTION GERAR_QRCode()
LOCAL cStr, cFile
cStr:="conteúdo do_qrcode"
cFile:="c:\arq.bmp"
QRcode(cStr,cFile)
RETURN NIL
FUNCTION QRcode( cStr, cFile )
#Define DC_CALL_STD 0x0020
LOCAL qrDLL
Generar_QR( cStr, cFile )
RETURN(NIL)
FUNC Generar_QR( cStr, cFile )
LOCAL nResp
LOCAL qrDLL
qrDLL:=LoadLibrary("QRCodelib.Dll" )
nResp:=DllCall(qrDLL,DC_CALL_STD,"FastQRCode",cStr,cFile)
FreeLibrary(qrDLL)
RETURN NIL
#Include "FiveWin.ch"
* HBZEBRA.LIB
* *********************************************************
* PROCEDURE MAIN
* PRINT oPRN PREVIEW
* PAGE
* EanQRCode(oPRN,50,50,1,"www.veneziasoft.com")
* ENDPAGE
* ENDPRINT
* RETURN
* *********************************************************
* iFlags = estratto da QRCODE.C della libreria HBZEBRA.LIB
*
* #define HB_ZEBRA_FLAG_QR_LEVEL_MASK 0x0700
* #define HB_ZEBRA_FLAG_QR_LEVEL_L 0x0100
* #define HB_ZEBRA_FLAG_QR_LEVEL_M 0x0200
* #define HB_ZEBRA_FLAG_QR_LEVEL_Q 0x0300
* #define HB_ZEBRA_FLAG_QR_LEVEL_H 0x0400
*
* switch( iFlags & HB_ZEBRA_FLAG_QR_LEVEL_MASK )
* {
* case HB_ZEBRA_FLAG_QR_LEVEL_M:
* iLevel = 1;
* break;
* case HB_ZEBRA_FLAG_QR_LEVEL_Q:
* iLevel = 2;
* break;
* case HB_ZEBRA_FLAG_QR_LEVEL_H:
* iLevel = 3;
* break;
* default:
* iLevel = 0;
* break;
*
* *********************************************************
* EanQRCode(oPRN, nY, nX, nWidth, nQRCODE, nColor, iFlags)
*
* oPRN = Output Device
* nY = Rigo di inizio stampa
* nX = Colonna di inizio stampa
* nWidth = Spessore del QRCODE - default = 1
* nQRCODE = Stringa del QRCODE
* nColor = Colore del QRCODE - default = CLR_BLACK
* iFlags = Flags
*
* *********************************************************
******************************************************************
Function EanQRCode(oPRN, nY, nX, nWidth, nQRCODE, nColor, iFlags)
Local hCODE,oBRUSH,nRET
Local nCLR:=IIF(nColor<>NIL,nColor,CLR_BLACK)
Local nLineWidth:=IIF(nWidth==NIL .OR. nWidth<1,1,nWidth)
Local nLineHeight:=nLineWidth
Local nSCALE:=7.2
hCODE:=hb_zebra_create_qrcode(nQRCODE,iFlags)
nY *= nSCALE
nLineWidth *= nSCALE
IF hCODE != NIL
IF hb_zebra_geterror( hCODE ) == 0
IF Empty( nLineHeight )
nLineHeight := 16
ENDIF
IF hb_zebra_geterror( hCODE ) != 0
RETURN HB_ZEBRA_ERROR_INVALIDZEBRA
Endif
DEFINE BRUSH oBRUSH COLOR nCLR
nRET:=hb_zebra_draw( hCODE, {|x,y,w,h| oPRN:FillRect({Int(y+.5), Int(x+.5), Int(y+.5)+Int(h)+1, Int(x+.5)+Int(w)},oBRUSH) }, nX*nSCALE, nY, nLineWidth, nLineHeight*nSCALE )
oBRUSH:End()
Endif
hb_zebra_destroy( hCODE )
Endif
Return nRET
Poderia me dicer qual e a function o comando para DllCall porque em essa linea da erro, noa reconoce esa function.
#include 'minigui.ch'
DECLARE DLL_TYPE_HBITMAP FastQRCode (DLL_TYPE_LPCSTR file, DLL_TYPE_LPCSTR path) IN QrCodeLib.dll
//
[b]Function QrCodigo()[/b]
cTexto:= '3188075019|120.54|22/04/2014' // Cualquier texto
cFile:= "facturaqr.bmp" // Puede ser [U:][ruta]<Arquivo.Ext>
FastQRCode(cTexto, cFile)
RETURN NIL
#define SALTO_PAGINA chr(12)
********************************
FUNCTION Imprime( cArq, tamrel ) // arquivo e tamanho da linha
********************************
local cTexto, nLinhas, nA, cLinha, oPrinter := win32prn()
oPrinter:New( GetDefaultPrinter() )
oPrinter:Landscape := .F.
oPrinter:FormType := 9
oPrinter:Copies := 1
if !oPrinter:Create()
Alert("Não foi possÃvel criar a impressão")
return NIL
endif
if ! oPrinter:StartDoc("Impressao xharbour")
Alert("StartDoc() - falhou ")
return NIL
endif
oPrinter:SetDefaultFont()
if tamrel > 80
oPrinter:setfont(,,17,,,,255)
else
oPrinter:setfont(,,11,,,,255)
endif
oPrinter:TextOut( space(tamrel), .T. )
cTexto := memoread( cArq )
nLinhas := mlcount( cTexto, tamrel, 1, .F. )
for nA := 1 to nLinhas
cLinha := memoline( cTexto, tamrel, nA, 1, .F. )
if left( alltrim( cLinha ), 1 ) == SALTO_PAGINA
oPrinter:NewPage()
else
oPrinter:TextOut( cLinha, .T. )
endif
next
oPrinter:EndDoc()
oPrinter:Destroy()
RETURN NIL
Usuários vendo este fórum: Google [Bot] e 12 visitantes