This sample uses the MW6Tech ActiveX control.
See https://www.mw6tech.com/qrcode/qrcode.html
This is not a free control.
The file, MW6QRCode.ZIP, contains the install program for the demo version of the ActiveX Control.
The barcode contains my name and address info.
Code: Select all
#INCLUDE "dcdialog.CH"
#Pragma Library("ascom10.lib")
FUNCTION Main()
LOCAL i, oCode, cString := ''
LOCAL nActualRows := 0, nActualCols := 0
LOCAL nActualWidth := 0, nActualHeight := 0
LOCAL nExtraWidth := 0, nExtraHeight := 0
oCode := CreateObject("MW6QRCode.QRCode")
TEXT INTO cString WRAP
Roger J. Donnay
1486 S. Loggers Pond Place
Apt. # 11
Boise, ID 83706
208-867-6091
ENDTEXT
oCode:Data := cString
// Get the actual rows and columns of QRCode barcode
oCode:GetActualRC(@nActualRows, @nActualCols)
// Get the actual QRCode barcode width and height
// The size value is based on computer screen resolution
oCode:GetActualSize( .T.,0, @nActualWidth, @nActualHeight )
IF .t.
oCode:SetSize(nActualWidth + nExtraWidth, nActualHeight + nExtraHeight)
ELSE
oCode:SetSize(nActualHeight + nExtraWidth, nActualWidth + nExtraHeight)
ENDIF
// Create a BMP file in the current folder
oCode:SaveAsBMP(DC_Path(AppName(.t.)) + "\MW6Demo.bmp")
RETURN nil