FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour CODIGO QR
Posts: 350
Joined: Wed Nov 02, 2005 03:28 PM
CODIGO QR
Posted: Mon Jul 15, 2013 02: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
Posts: 120
Joined: Wed Mar 11, 2009 07:32 PM
Re: CODIGO QR
Posted: Mon Jul 15, 2013 09: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. Obreg贸n, Sonora, M茅xico
chino72vale@hotmail.com
Fivewin 24.04, Harbour 3.3, xharbour 1.2.1, Fivelinux, Visual Estudio 2022
Oracle Api Rest, SDK Contpaq, Facturaci贸n Electr贸nica, XML DIOT 2025
Posts: 350
Joined: Wed Nov 02, 2005 03:28 PM
Re: CODIGO QR
Posted: 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
Posts: 326
Joined: Sun Oct 09, 2005 05:22 PM
Re: CODIGO QR
Posted: Tue Jul 16, 2013 02:52 PM
Hace tiempo encontr茅 esto y me ha funcionado (es free).

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

Code (fw): Select all Collapse
#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)
Posts: 58
Joined: Thu Oct 13, 2005 01:26 PM
Re: CODIGO QR
Posted: Tue Jul 16, 2013 06: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

Posts: 350
Joined: Wed Nov 02, 2005 03:28 PM
Re: CODIGO QR
Posted: Wed Jul 17, 2013 07: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

Continue the discussion