Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: PowerBasic Examples

PowerBasic Examples 4 years 3 months ago #3876

COMPILE EXE
#DIM ALL
%ENC_ALPHA = 0
%ENC_BYTE = 1
%ENC_NUMERIC = 2
%ENC_CHINESE = 3
%ENC_AUTO = 4

%FNC1_MODE_NO = 0
%FNC1_MODE_FIRST = 1
%FNC1_MODE_SECOND = 2

%CORRECTION_LEVEL_L = 0
%CORRECTION_LEVEL_M = 1
%CORRECTION_LEVEL_Q = 2
%CORRECTION_LEVEL_H = 3

%MICROQR_VER_M1 = 0
%MICROQR_VER_M2 = 1
%MICROQR_VER_M3 = 2
%MICROQR_VER_M4 = 3


TYPE QRCODECONTEXT DWORD FILL
version AS LONG
correctionLevel AS LONG
encoding AS LONG
eci AS LONG
fnc1Mode AS LONG
structuredAppendIndex AS LONG
structuredAppendCounter AS LONG
applicationIndicator AS LONG
structuredAppend AS BYTE
processTilde AS BYTE
autoConfigurate AS BYTE
cData(1 TO 7100) AS BYTE
nSize AS LONG
nMargin AS BYTE
nPixelSize AS BYTE
clBackGround AS DWORD
clForeGround AS DWORD
END TYPE
DECLARE SUB InitWorkSpace LIB "QrCodeEncodeDLL.dll" ALIAS "InitWorkSpace"(BYREF pQRCodeCtx AS QRCODECONTEXT)
DECLARE FUNCTION FreeWorkSpace LIB "QrCodeEncodeDLL.dll" ALIAS "FreeWorkSpace" AS LONG
DECLARE FUNCTION QRCodeEncode2Bitmap LIB "QrCodeEncodeDLL.dll" ALIAS "QRCodeEncode2Bitmap" (BYREF pQRCodeCtx AS QRCODECONTEXT) AS DWORD
DECLARE FUNCTION QRCodeEncode2File LIB "QrCodeEncodeDLL.dll" ALIAS "QRCodeEncode2File" (BYREF pQRCodeCtx AS QRCODECONTEXT, BYVAL pImageFile AS STRING) AS LONG

FUNCTION PBMAIN () AS LONG
DIM ctx AS QRCODECONTEXT
DIM aa AS DWORD
initworkspace ctx
ctx.CorrectionLevel=2
ctx.AutoConfigurate=1
ctx.nMargin =20
ctx.nPixelSize= 10
ctx.cData(1)= 48
ctx.cData(2)= 48
ctx.cData(3)= 48
ctx.cData(4)= 48
ctx.cData(5)= 48
ctx.nSize = 5
aa= QRCodeEncode2Bitmap(ctx) 'Create barcode and draw to a Bitmap
aa=QRCodeEncode2File(ctx,"c:\tt.bmp") 'Create barcode and save it to a Bitmap file
END FUNCTION
The administrator has disabled public write access.

  • Posts:59
  • developer's Avatar
  • developer
  • Moderator
  • OFFLINE
  • Karma: 1
  • Page:
  • 1
Time to create page: 0.988 seconds
Powered by Kunena Forum :: Wibi