I knew about the compiler specific issues, but how the "?" are compiled in PBCC and PBWIN did not cross my mind, So thanks for that Stuart!
So there we have it Single SLL cross compiler. (when applying changes in post #4).
X
-
Originally posted by Rod Macia View PostI also noticed that the SLL only works in the environment of the compiler used. So if compiled with PBWIN it will not LINK with PBCC programs, and vise versa.
'Code:... IF (LEN(MsgIn) + nsym) > 255 THEN ? "Message is too long (" + DEC$(LEN(MsgIn) + nsym) + " when max is 255)" ... ? "GdipSaveImageToFile - status code: " & STR$(hStatus) '
Since those are compiler specific, the SLL is not "cross-compiler compatible"
See: https://forum.powerbasic.com/forum/u...565#post814565
Commenting thos lines or doing the following makes the SLL usable with either compiler, both for creating the SLL and for linking it.
'Code:#INCLUDE "Win32API.inc" ... IF (LEN(MsgIn) + nsym) > 255 THEN messagebox(0, "Message is too long (" + DEC$(LEN(MsgIn) + nsym) + " when max is 255)" ,"",0) ... messagebox 0, "GdipSaveImageToFile - status code: " & STR$(hStatus),"",0 '
Leave a comment:
-
What's New:- Substantial Speed improvement.
- we can now also save as SVG vector graphic image. (used in web, and preferred in publications like big signs and posters)
New Function Save SVG
Code:' Save as SVG vector graphic (useful in web, or on big posters) small file for huge images ' Matrix, File Name, border, Magnification, background color, dots color SaveQRCodeAsSVG (aQRMatrix(),"myImage.svg", 3, 6, %WHITE, %BLACK)
Included in zip:
Create QRCode PBCC.bas (test source code for PBCC)
Create QRCodePBCC SLL.bas (SLL source code for PBCC)
Create QRCode.bas (test source code for PBWIN)
Create QRCode SLL.bas (SLL source code for PBWIN)
QRCode.SLL
QRCodePBCC.SLL
(I have no plans to further work on this unless bugs are found)Attached Files
Leave a comment:
-
Cool! I am going to have to figure out what is going on here!
WOW! This is amazing!
Leave a comment:
-
QRCode using PB
It's not a complete QRCode library, but it covers it enough to be very useful. Encodes Numeric, Alpha Numeric, Byte.
You can display into a graphic control/windows
Code:sText = "otpauth://totp/MyCompany?secret=NAR5XTDD3EQU22YU" '// Create the QRCode matrix '// (DataToMakeIntoQR, ErrorCorectionLevel, ArrayToPutMatrixIn) returns version used for supplied data Version = CreateQRCode (sText, 3, aQRMatrix()) ' 1=L 7%, 2=M 15%, 3=Q 25%, 4=H 30% '//Convert Matrix into device-independent bitmap in a dynamic string and then display it in a control or Graphic Window sBuffer = GetQRCodeAsBITSstr (aQRMatrix(), 3, 6) ' Matrix, border, Magnification lgWidth = CVL(sBuffer,1) lgHeight = CVL(sBuffer,5) GRAPHIC WINDOW NEW "Version "+FORMAT$(Version), 10, 10, lgWidth, lgHeight TO hWinVar GRAPHIC ATTACH hWinVar, 0 GRAPHIC SET BITS sBuffer GRAPHIC WAITKEY$
Code:sText = "otpauth://totp/MyCompany?secret=NAR5XTDD3EQU22YU" '// Create the QRCode matrix '// (DataToMakeIntoQR, ErrorCorectionLevel, ArrayToPutMatrixIn) returns version used for supplied data Version = CreateQRCode (sText, 3, aQRMatrix()) ' 1=L 7%, 2=M 15%, 3=Q 25%, 4=H 30% '// Save QRCode as an image filename extention determins format ie: myImage.png myImage.jpg myImage.tif myImage.gif myImage.bmp SaveQRCodeAsImage (aQRMatrix(),"myImage.png", 3, 6) ' Matrix, File Name, border, Magnification
Print QRCode
Code:sText = "otpauth://totp/MyCompany?secret=NAR5XTDD3EQU22YU" '// Create the QRCode matrix '// (DataToMakeIntoQR, ErrorCorectionLevel, ArrayToPutMatrixIn) returns version used for supplied data Version = CreateQRCode (sText, 3, aQRMatrix()) ' 1=L 7%, 2=M 15%, 3=Q 25%, 4=H 30% '//Convert Matrix into device-independent bitmap in a dynamic string and then Print it LOCAL xsize, ysize, hbmp, hbmp2 AS LONG sBuffer = GetQRCodeAsBITSstr (aQRMatrix(), 3, 6) ' Matrix, border, Magnification IF sBuffer <> "" THEN xsize = CVL(sBuffer,1) ' Get Size of Bar Code ysize = CVL(sBuffer,5) GRAPHIC BITMAP NEW xsize, ysize TO hbmp ' Create bitmap 1 GRAPHIC ATTACH hbmp,0 GRAPHIC SET BITS sBuffer ' Put BITS in it GRAPHIC BITMAP NEW xsize*2, ysize*2 TO hbmp2 ' Create bitmap double size GRAPHIC ATTACH hbmp2,0 GRAPHIC STRETCH PAGE hBmp, 0 ' stretch bitmap 1 in it XPRINT ATTACH CHOOSE XPRINT SCALE (0,0)-(8.5,11) 'scale paper size XPRINT XPRINT " Page Scaled at (8.5,11)" XPRINT " BMP1 size : " + FORMAT$(xsize),FORMAT$(ysize) XPRINT " Scaled size : " + FORMAT$(xsize / XPRINT(PPI.X), 4),FORMAT$(ysize / XPRINT(PPI.Y),4) XPRINT " BMP2 size : " + FORMAT$(xsize*2),FORMAT$(ysize*2) XPRINT " Scaled size : " + FORMAT$(xsize*2 / XPRINT(PPI.X), 4),FORMAT$(ysize*2 / XPRINT(PPI.Y),4) XPRINT SET POS (5, .5) XPRINT "Barcode under me" XPRINT COPY hbmp, 0 TO (5, 0.7) 'put barcode at 5 in x .7 in XPRINT COPY hbmp2, 0 TO (5-((xsize*2/XPRINT(PPI.X)+.1)), ysize/ XPRINT(PPI.Y)+.8) XPRINT CLOSE GRAPHIC ATTACH hbmp,0 ' Cleanup GRAPHIC BITMAP END GRAPHIC ATTACH hbmp2,0 GRAPHIC BITMAP END END IF
Attached FilesTags: None
Leave a comment: