FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour QR code
Posts: 243
Joined: Wed Sep 19, 2007 04:32 PM
QR code
Posted: Thu Dec 05, 2013 03:38 PM

Hello everyone.
In my country is requiring PC printed bills are adding a QR code.
Anyone know how to start something.

Oscar A. Martinez
http://www.multisofthn.com
Honduras, Centro America
xHarbour Enterprise 1.2.2, Fivewin 13.06
Posts: 223
Joined: Thu Dec 01, 2005 03:34 PM
Re: QR code
Posted: Thu Dec 05, 2013 04:16 PM

What is a QR code?

Posts: 1054
Joined: Sun Oct 09, 2005 10:41 PM
Re: QR code
Posted: Thu Dec 05, 2013 04:20 PM

Hi, use this code......
/--------------------------------------------------------------------------------------------------
Function QRGenerator(cTexto, cPath, cBmp) // genera codigo qr
local cStr, cFile
LOCAL nResp

Define DC_CALL_STD 0x0020

STATIC qrDLL

DEFAULT cPath := "BMP\"
DEFAULT cBmp := "QR.bmp"
DEFAULT cTexto := "SVITE SOFTWARE ADMINISTRATIVO"

IF !FILE("QRCodelib.Dll")
MsgStop("Sin Librería de Soporte","Improcedente")
Return(NIl)
EndIF

cStr := cTexto //"Texto a QR Code"
cFile := cPath + cBmp

qrDLL:=LoadLibrary("QRCodelib.Dll" )
nResp:=DllCall(qrDLL,DC_CALL_STD,"FastQRCode",cStr,cFile)
FreeLibrary(qrDLL)

RETURN (cFile)

Posts: 243
Joined: Wed Sep 19, 2007 04:32 PM
Re: QR code
Posted: Thu Dec 05, 2013 05:37 PM
Roger
Here a detail of QR Codes
http://marksprague.wordpress.com/qr-codes-technology/understanding-qr-codes/

Willy thanks for replying.
I have seen that there is a range of variants QRCodelib.Dll
And I found are extra, which you are using?
To avoid falling into bad experiences or headaches?
Oscar A. Martinez
http://www.multisofthn.com
Honduras, Centro America
xHarbour Enterprise 1.2.2, Fivewin 13.06
Posts: 243
Joined: Wed Sep 19, 2007 04:32 PM
Re: QR code
Posted: Thu Dec 05, 2013 06:41 PM
thanks

I found this same example, the forum fivewin brasil
http://fivewin.com.br/index.php?/topic/21274-qr-code-resolvido/

And there's the download link QRCodelib.Dll
http://www.oho.com.br/fw/qr.zip
Oscar A. Martinez
http://www.multisofthn.com
Honduras, Centro America
xHarbour Enterprise 1.2.2, Fivewin 13.06
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: QR code
Posted: Thu Dec 05, 2013 08:26 PM

Hello

Harbour support QR code without use any DLL, locate in contributions "zebra"

Posts: 1445
Joined: Mon Oct 10, 2005 02:38 PM
Re: QR code
Posted: Fri Dec 06, 2013 11:58 AM
Daniel Garcia-Gil wrote:Hello

Harbour support QR code without use any DLL, locate in contributions "zebra"


Daniel,
Sabes si hay algun ejemplo en la versión que se distribuye de Fivewin?
Se pueden consultar algun ejemplo en algún lugar?
Que LIB se debe lincar la aplición?

Gracias,

Un Saludo

Carlos G.



FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Posts: 58
Joined: Thu Oct 13, 2005 01:26 PM
Re: QR code
Posted: Wed Dec 11, 2013 07:03 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) }, nXnSCALE, nY, nLineWidth, nLineHeightnSCALE )
oBRUSH:End()

Endif
hb_zebra_destroy( hCODE )

Endif
Return nRET

===

Saluti

Santo Venezia

Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: QR code
Posted: Thu Nov 03, 2016 06:12 PM

Ottima funzione, molto utile !

E' possibile stampare il QRCode anche nei Report oltre che nelle printer


Good function to print a QrCode in oprn:...

Is it possible to print the QrCode also in a report ?

Grazie

Romeo/Zngoni

Posts: 7
Joined: Sat Jan 28, 2017 05:08 AM
Re: QR code
Posted: Sat Jan 28, 2017 06:22 PM

Hola estoy buscando una aplicacion que me pueda sacar el codigo qr de algun texto.
Quisiera saber si alguien tiene una app ya compilada y su codigo fuente en fwh que pudiera proporcionarme.

Mi correo: manuelantonio960504@gmail.com

Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: QR code
Posted: Fri Jun 16, 2017 10:57 AM

Hi

How to read QR code data?

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: QR code
Posted: Fri Jun 16, 2017 12:37 PM
richard

In android I use barcode scanner
https://github.com/zxing/zxing

It works fine!
bye
Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: QR code
Posted: Fri Jun 16, 2017 12:49 PM

Romeo,
Since I still use ReportPro in my programs I create a bmp file containing image of qrcode in a subfolder and from report I create an object
Picture source "File Name returned from an expression"
For instance in my table of articles there is a field named qrcode

Bye

Marco Boschi
info@marcoboschi.it

Continue the discussion