CODIGO QR

CODIGO QR

Postby Garbi » Mon Jul 15, 2013 2:36 pm

Hola a todos, tengo que implementar en una aplicación la impresión de códigos QR (puesto que tengo que poner bastante información y este tipo de código admite hasta 4.296 caracteres alfanuméricos)

¿Alguien echarme una mano?
Saludos,
Regards,

Jose Luis Alepuz
joseluis@mancomputer.com
www.mancomputer.com
Garbi
 
Posts: 291
Joined: Wed Nov 02, 2005 3:28 pm

Re: CODIGO QR

Postby benjiben143 » Mon Jul 15, 2013 9:34 pm

hola buenos dias

puedes bajar en la pagina

https://code.google.com/p/qrencode-win32/downloads/list

y te instala archivos ejecutables

el que hace la creacion del qr es qrcode

ayi mismo tiene test.bat

que nos indica como llamar el qrcode.exe para que nos genere el archivo qr

ejemplo
qrcode.exe -o test.png -s 5 -l H http://fukuchi.org/works/qrencode/index.en.html

para llamarlo desde fwh

WAITRUN("test.bat", .T.)

y nos crea en formato .png el codigo qr

ya seria manipular el texto que queremos mandar con fcreate , fwrite y fclose

en la misma pagian estan los fuentes y es libre

hace poco tiempo hice con una funcion leer un pdf, extraer las imagenes y de las imagenes leer el contenido del codigo qr
quedando completo ,,, creacion / lectura ay si te interesa te lo mando


saludos
Benjamin Casarrubias Moreno
Cd. Obregon, Sonora, Mexico
chino72vale@hotmail.com
Fivewin 16.05, Harbour 3.2, xharbour 1.2.1, Fivelinux, visual estudio 2013
benjiben143
 
Posts: 114
Joined: Wed Mar 11, 2009 7:32 pm
Location: Obregon, Sonora, Mexico

Re: CODIGO QR

Postby Garbi » Tue Jul 16, 2013 10:00 am

Gracias voy a probarlo ahora mismo.
Si tengo dudas no te preocupes que ya te lo dire,jajaja
de nuevo Muchas Gracias.
Saludos,
Regards,

Jose Luis Alepuz
joseluis@mancomputer.com
www.mancomputer.com
Garbi
 
Posts: 291
Joined: Wed Nov 02, 2005 3:28 pm

Re: CODIGO QR

Postby Alfredo Arteaga » Tue Jul 16, 2013 2:52 pm

Hace tiempo encontré esto y me ha funcionado (es free).

http://www.despachoarteaga.com.mx/desca ... odeLib.Dll

Code: Select all  Expand view

#Define DC_CALL_STD  0x0020

GLOBAL qrDLL

cStr:="Texto a QR Code"
cFile:=".\Archivo.Bmp"

FUNC Generar_QR(cStr,cFile)
   LOCAL nResp
   qrDLL:=LoadLibrary("QRCodelib.Dll" )
   nResp:=DllCall(qrDLL,DC_CALL_STD,"FastQRCode",cStr,cFile)
   FreeLibrary(qrDLL)
RETURN (NIL)
 
User avatar
Alfredo Arteaga
 
Posts: 326
Joined: Sun Oct 09, 2005 5:22 pm
Location: Mexico

Re: CODIGO QR

Postby vensanto » Tue Jul 16, 2013 6:57 pm

Ciao
questa è la funzione che utilizzo per stampare il QRCode
spero vi possa essere utile

===

#Include "FiveWin.ch"

* richiede la libreria 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

===

Saluti

Santo Venezia
User avatar
vensanto
 
Posts: 58
Joined: Thu Oct 13, 2005 1:26 pm
Location: ITALIA

Re: CODIGO QR

Postby Garbi » Wed Jul 17, 2013 7:50 am

Muchas Gracias a todos. La primera opción me funciono de maravilla. pero probare todas para ver cual me funciona mejor para mi aplicación.
Ya os contare y repito muchas gracias a todos.
Saludos,
Regards,

Jose Luis Alepuz
joseluis@mancomputer.com
www.mancomputer.com
Garbi
 
Posts: 291
Joined: Wed Nov 02, 2005 3:28 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests