QR barcode generator

Post your tools and samples or ask for them.
landaware
Argentina
Posts: 14
Joined: 30 Jul 2017, 18:27
Location: Argentina

QR barcode generator

Post by landaware » 19 Jul 2018, 12:30

Hi guys,

I need an example using QR codebar in CTD30, anyone who can share a sample?

Thanks and regards,
Steve

Didiman
Germany
Posts: 176
Joined: 21 Mar 2017, 13:05
Location: Bremen, Germany

QR Codebar

Post by Didiman » 19 Jul 2018, 14:54

Hi, this is the Interface for quricol32.dll - http://delphi32.blogspot.com/2011/11/qu ... brary.html

Code: Select all

!!CB!! 81
Library name: quricol32.dll
	ThreadSafe: No
	Function: GeneratePNGW
		Description:
		Export Ordinal: 0
		Returns
		Parameters
			String: LPWSTR
			String: LPWSTR
			Number: INT
			Number: INT
			Number: INT
	Function: GetHBitmapW
		Description:
		Export Ordinal: 0
		Returns
			Number: HANDLE
		Parameters
			String: LPWSTR
			Number: INT
			Number: INT
			Number: INT
	Function: GenerateBMPW
		Description:
		Export Ordinal: 0
		Returns
		Parameters
			String: LPWSTR
			String: LPWSTR
			Number: INT
			Number: INT
			Number: INT
and this is how i use it

Code: Select all

!!CB!! 244
Functional Class: cCls_QRCode
	Description: Klasse zum Erzeugen von QR Codes
	Derived From
	Class Variables
	Instance Variables
	Functions
		Function: bGeneratePNG
			Description: Erzeugt eine PNG-Datei aus den übergebenen Daten.
			Returns
				Boolean:
			Parameters
				String: sFilename
				String: sContent
				Number: nMargin
				Number: nPixelsize
				Number: nCorrection
			Static Variables
			Local variables
			Actions
				Return .._bGeneratePNG(sFilename,sContent,nMargin,nPixelsize,nCorrection)
		Function: _bGeneratePNG
			Description:
			Returns
				Boolean:
			Parameters
				String: sFilename
				String: sContent
				Number: nMargin
				Number: nPixelsize
				Number: nCorrection
			Static Variables
			Local variables
			Actions
				Call GeneratePNGW( sFilename,sContent,nMargin,nPixelsize,nCorrection )
				Return VisDosExist( sFilename )
		Function: bGenerateBMP
			Description: Erzeugt eine BMP-Datei aus den übergebenen Daten.
			Returns
				Boolean:
			Parameters
				String: sFilename
				String: sContent
				Number: nMargin
				Number: nPixelsize
				Number: nCorrection
			Static Variables
			Local variables
			Actions
				Return .._bGenerateBMP(sFilename,sContent,nMargin,nPixelsize,nCorrection)
		Function: _bGenerateBMP
			Description:
			Returns
				Boolean:
			Parameters
				String: sFilename
				String: sContent
				Number: nMargin
				Number: nPixelsize
				Number: nCorrection
			Static Variables
			Local variables
			Actions
				Call GenerateBMPW( sFilename,sContent,nMargin,nPixelsize,nCorrection )
				Return VisDosExist( sFilename )
		!
		Function: bShowQRCode
			Description: Zeigt den QR-Code in einem PIC-Control an.
			Returns
				Boolean:
			Parameters
				Window Handle: hWndPic
				String: sContent
				Number: nMargin
				Number: nPixelsize
				Number: nCorrection
			Static Variables
			Local variables
			Actions
				Return .._bShowQRCode(hWndPic,sContent,nMargin,nPixelsize,nCorrection)
		Function: _bShowQRCode
			Description:
			Returns
				Boolean:
			Parameters
				Window Handle: hWndPic
				String: sContent
				Number: nMargin
				Number: nPixelsize
				Number: nCorrection
			Static Variables
			Local variables
				String: sPicture
			Actions
				If MImgGetString( MImgLoadFromHandle( GetHBitmapW( sContent, nMargin, nPixelsize, nCorrection ), MIMG_TYPE_BMP ), sPicture, MIMG_TYPE_BMP )
					Call SalPicSetString( hWndPic, PIC_ImageTypeBMP, sPicture )
					Return TRUE
				Return FALSE
		!
		Function: sGetQRString
			Description: Gibt den  QR-Code als String zurück, der für Report als Object im Piccontrol angedruckt werden kann.
			Returns
				String:
			Parameters
				String: sContent
				Number: nMargin
				Number: nPixelsize
				Number: nCorrection
			Static Variables
			Local variables
			Actions
				Return .._sGetQRString(sContent, nMargin,nPixelsize,nCorrection)
		Function: _sGetQRString
			Description:
			Returns
				String:
			Parameters
				String: sContent
				Number: nMargin
				Number: nPixelsize
				Number: nCorrection
			Static Variables
			Local variables
				String: sPicture
			Actions
				If MImgGetString( MImgLoadFromHandle( GetHBitmapW( sContent, nMargin, nPixelsize, nCorrection ), MIMG_TYPE_BMP ), sPicture, MIMG_TYPE_BMP )
					Return sPicture
				Else
					Return ''

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1114
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

QR Codebar

Post by Dave Rabelink » 24 Jul 2018, 12:23

A fully working TD implementation of Quricol - QR code generator library can be found on the WIKI, here:

http://wiki.tdcommunity.net/index.php/T ... or_library
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

saka06
Japan
Posts: 1
Joined: 24 May 2017, 05:48
Location: Japan

Re: QR barcode generator

Post by saka06 » 09 Nov 2018, 07:14

Hello Dave

Thank you for useful sample.

May I have a sample program of print out on qrp file?

I tried as below but error.

Call SalReportPrint( hWndForm, 'QR.QRP',
':picQR',
'QRCODE',
1, RPT_PrintAll, 1, 1, nPRecieveError)

TD version 6.1 SP4

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1114
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: QR barcode generator

Post by Dave Rabelink » 09 Nov 2018, 11:02

Save the barcode as BMP to file.

Then read the bitmap file into a string:

Code: Select all

Set sFile = "MySavedBarcode.bmp"
If SalFileOpen( hFile, sFile , OF_Read | OF_Binary )
	Call SalFileRead( hFile, lsBitmap, VisFileGetSize( sFile ) )
	Call SalFileClose( hFile )
String lsBitmap contains the image.


Then pass the string variable as input item to the QRP:

Code: Select all

SalReportView( hWndForm, hWndNULL, 'ReportBarcode.qrp', ":lsBitmap", "lsBitmap", nFlags )
The QRP has input item defined as type Object (above it has the name lsBitmap)

The picture object in the QRP is linked to the input item.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Return to “Tools & Samples”

Who is online

Users browsing this forum: [Ccbot] and 0 guests