-
Re: [VB6/VBA] QR Code generator library
The bitmap produced *is* a DIB actually. No idea what's going on, probably some incompatibility that I cannot debug as I don't have Office 2000.
If someone fixes this problem they are free to send a Pull Request to the repo, it will be merged immediately.
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
put text to get qrocde err,why?
Code:
text1.text="http://www.baidu.com/34134123412341234341234123412341341341343313123131313k1k3k1k3k1k3k1k3k1k3k1k31k13k13k1"
-
Re: [VB6/VBA] QR Code generator library
Does nayuki's live demo produce correct QR Code when you put the same text string?
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
Border:
In nayuki's live demo, there is an option to set the border (width) - measured in QR code 'bits' as the unit.
I've looked through your implementation for 'border'. But can't find any reference or setting.
Can you give me any hints as to passing a parameter to set the border width.
Thx, Alan
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
Alan Lamb
Border:
In nayuki's live demo, there is an option to set the border (width) - measured in QR code 'bits' as the unit.
I've looked through your implementation for 'border'. But can't find any reference or setting.
Can you give me any hints as to passing a parameter to set the border width.
Thx, Alan
No, this is not implemented. You have to manually place the QR Code so that there is enough margin as you deem proper.
Most scanners are able to read QR Codes (and barcodes) with no margins at all so the standard requirements for empty borders around the image are optional in practice and mostly not heeded by anyone printing QR Codes/barcodes on paper.
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
Hi,
I have a little problem with this QR code generator library. I'm using Access 2016 (I think it's use VB 7.1) and can not compile the code, always show this error message: Compile error: User-definied type not definied.
What can I do?
Attachment 189235
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
Scannia
What can I do?
Hi,
You can start by sharing some more info about this error.
Which line number is this error at? Is you Office installation 32-bit or 64-bit version?
cheers,
</wqw>
-
1 Attachment(s)
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
wqweto
Hi,
You can start by sharing some more info about this error.
Which line number is this error at? Is you Office installation 32-bit or 64-bit version?
cheers,
</wqw>
Access 2016 64 bit version, on Windows 10 22H2.
As you see on the attached screenshot, the Editor select from the line 169 to 177 the Public Function QRCodegenBarcode() segment.
Attachment 189236
-
Re: [VB6/VBA] QR Code generator library
Weird! Your project is probably missing reference to "OLE Automation".
Open Tools->References and make sure "OLE Automation" is checked in the available references list.
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
wqweto
Weird! Your project is probably missing reference to "OLE Automation".
Open Tools->References and make sure "OLE Automation" is checked in the available references list.
cheers,
</wqw>
Yes, this OLE Automation was missing.
Thank you!
-
Re: [VB6/VBA] QR Code generator library
i have a problem in spain with special characters like ñ Ñ á é í ó ú ... I think i have to change utf-8 page, here
Private Function pvToUtf8Array(sText As String) As Byte()
Const CP_UTF8 As Long = 65001
but i don't know the number
-
Re: [VB6/VBA] QR Code generator library
Can you upload/post here a generated QR barcode which contains problematic spanish special symbols?
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
imasred
i have a problem in spain with special characters like ñ Ñ á é í ó ú ... I think i have to change utf-8 page, here
Private Function pvToUtf8Array(sText As String) As Byte()
Const CP_UTF8 As Long = 65001
but i don't know the number
I try using spanish chars, and works fine.
-
1 Attachment(s)
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
wqweto
Can you upload/post here a generated QR barcode which contains problematic spanish special symbols?
I think it is a problem with the regional configuration of my Windows. I'm trying to upload an image.
I edit the post, sorry. My windows regional settings are ok, because all keys of my keyboard work correctly and I can type things like "camión español"
-
Re: [VB6/VBA] QR Code generator library
When I san the code, I get "camión español" ... so something is working...
-tg
-
1 Attachment(s)
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
techgnome
When I san the code, I get "camión español" ... so something is working...
-tg
:(:blush: the problem was my phone. Sorry.
-
Re: [VB6/VBA] QR Code generator library
Font issue? That's ... wow... would not expect that to happen...
-tg
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
techgnome
Font issue? That's ... wow... would not expect that to happen...
-tg
i don't know. I used the default QR reader from my new Xiaomi Redmi 12 and reads wrongly. But with any other free they read perfectly :)
... thank you
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
imasred
i don't know. I used the default QR reader from my new Xiaomi Redmi 12 and reads wrongly. But with any other free they read perfectly :)
... thank you
handphone also got Language setting, you try to change to prefer one.
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
imasred
:(:blush: the problem was my phone. Sorry.
The QR reader you are using does not recognize UTF-8 encoding and switches to some crazy japanese kanji or whatever encoding QR code originally used. The fun fact is that QR codes *predate* UTF-8 so these cannot possible originally use UTF-8 and solve most of their enconding issue so they had to mess up with encoding which ended not so good and most reader implementations are needlessly complicated. Nowadays most everyone silently assumes input stream is proper UTF-8 encoded text unless explicitly configured to use kanji chartacter sets and whatever.
Well, at least now you seen some kanji japanese letters which is got in place of spanish special characters :-)) This is not so common to see, an ordinary Unicode mess up ends up in some form of Chineese only :-))
The problem is in the configuration of your phone's QR code reader, not in your phone per se. You can fix it but switching a setting to always use UTF-8 most probably, unfotunately specifics of where and what are not available here. . .
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
Hi,
Is it possible to generate Datamatrix code with this program?
thank you
-
1 Attachment(s)
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
Scannia
Hi,
Is it possible to generate Datamatrix code with this program?
thank you
I think this project only creates QR Codes, to create other type of BarCodes you can try the attached project, thats creates more code bars types, including DataMatrix.
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
gilman
I think this project only creates QR Codes, to create other type of BarCodes you can try the attached project, thats creates more code bars types, including DataMatrix.
Btw, this sample uses ZXing library as an external dependacy which is a Java behemoth. The library can appraently produce QR Codes too among many other formats *and* its primary target is actually scanning barcodes it seems.
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
wqweto
Btw, this sample uses
ZXing library as an external dependacy which is a Java behemoth. The library can appraently produce QR Codes too among many other formats *and* its primary target is actually scanning barcodes it seems.
cheers,
</wqw>
Yes, and the sample also allows scan barcodes from files
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
gilman
Yes, and the sample also allows scan barcodes from files
Honestly hope that no one in his right mind decides it's a good idea to use a Java library for about anything and tirelessly search for replacement using *any* other technology (even .Net).
This thread is about being and staying lean, using less code, particularly with small VBx modules, with no dependencies to produce usable and performant solutions.
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
I just posted in the codebank code Barcode & QRCode reader using ZXing
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
gilman
I think this project only creates QR Codes, to create other type of BarCodes you can try the attached project, thats creates more code bars types, including DataMatrix.
Thanks, but I can't use it in my Access 2016 database and yes, it's too big for me.
I need searching another solution, which is "simple" VB6 code without any external DLL, ActiveX, etc.
Thanks!
-
Re: [VB6/VBA] QR Code generator library
hey all. beginner here. Tried to save the generated QRcode into a file
SavePicture Image1.Picture, "c:\share\1.bmp"
but when opened, the error says "file format not supported"? The file size saved is about 28kB though
any help?
-
Re: [VB6/VBA] QR Code generator library
The QR barcode image is generated to a vector picture.
Try using C:\Share\1.emf or 1.wmf for target filename.
-
Re: [VB6/VBA] QR Code generator library
ok great. It's working now with 1.emf extension. Thanks so much!
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
saturnian
Very nice code !
I made a small modification: I transformed the LNG_STEP constant into a variable to be able to modify the size of the QR code and copy it to the clipboard.
This then makes it possible to insert it into a Word document, for example, or any other application...
Attachment 185982
Many thanks wqweto !
François
Dim Pic As StdPicture
Set Pic = QRCodegenBarcode(Text1.Text, 0, QRCodegenEcc_LOW, 1, 5, , , HScroll1.Value)
'SavePicture Pic, App.Path & "\123.emf" 'it's not bmp format
how to save as bmp,without picture1 control?
'Set Picture1.Picture = GetQrcodePic("123", HScroll1.Value)
Picture1.Picture = QRCodegenBarcode?
-
Re: [VB6/VBA] QR Code generator library
It's very easy and you don't need a PictureBox or anything else because there is a dedicated procedure in the module you can use for rasterization.
Just read this issue in the repo itself: https://github.com/wqweto/VbQRCodegen/issues/7
cheers,
</wqw>
-
1 Attachment(s)
Re: [VB6/VBA] QR Code generator library
why do this? 'lModuleSize = Int((Image1.Width * 15) / (lQrSize * Screen.TwipsPerPixelX) + 0.5)
Why is there a black edge on the top?
Now that the function is normal, is there any way for him to generate a QR code full of squares, instead of rounding it?
https://github.com/wqweto/VbQRCodege...dQRCodegen.bas
Code:
SavePicture GetQrCodePic("https://www.vbforums.com", 500), App.Path & "\test4.bmp"
Function GetQrCodePic(Txt As String, Width As Long) As StdPicture
Dim baBarCode() As Byte
Dim lQrSize As Long
Dim lModuleSize As Long
If QRCodegenEncode(Txt, baBarCode) Then
lQrSize = QRCodegenGetSize(baBarCode)
'lModuleSize = Int((Image1.Width * 15) / (lQrSize * Screen.TwipsPerPixelX) + 0.5)
lModuleSize = Int((Width * 15) / (lQrSize * Screen.TwipsPerPixelX) + 0.5)
Set GetQrCodePic = QRCodegenResizePicture(QRCodegenResizePicture(QRCodegenConvertToPicture(baBarCode, vbBlack, ModuleSize:=lModuleSize, SquareModules:=False), Width * 4, Width * 4), Width, Width)
Erase baBarCode
End If
End Function
-
Re: [VB6/VBA] QR Code generator library
Please, don't post non-sense in this thread.
The edge of your PrictureBox is controlled by Border property of the PictureBox control, it has nothing to do with lModuleSize = Int((Image1.Width * 15) / (lQrSize * Screen.TwipsPerPixelX) + 0.5) code you are citing.
> Now that the function is normal, is there any way for him to generate a QR code full of squares, instead of rounding it?
You are calling the procedure with SquareModules:=False, what do you expect? Did you try SquareModules:=True?
Edit: Take your time to run and research the test project in test subdirectory before asking more questions, please. Most everything you asked so far is implemented there.
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
i don't use picture1 box,only get pic as stdpicture and savebmp
lModuleSize = Width
Now there won't be an extra black edge.
The data size of lModuleSize has changed, and the status of QR code has not changed.?
-
Re: [VB6/VBA] QR Code generator library
Sorry, I currently cannot help you because the comminucation loss is severe. If this module does not work ok for you just find something else to produce QR Codes with.
cheers,
</wqw>
-
Re: [VB6/VBA] QR Code generator library
At the beginning, the VB QR module can be used to export the two-dimensional code image, but after saving, it is very small, maybe only 30 X 30 pixels. I don't know how to enlarge it. It took me a lot of time to find a way to enlarge it. Thanks very much.
-
Re: [VB6/VBA] QR Code generator library
-
Re: [VB6/VBA] QR Code generator library
Quote:
Originally Posted by
saturnian
Very nice code !
I made a small modification: I transformed the LNG_STEP constant into a variable to be able to modify the size of the QR code and copy it to the clipboard.
This then makes it possible to insert it into a Word document, for example, or any other application...
Attachment 185982
Many thanks wqweto !
François
Hi There,
I did downloaded the mentioned Module, but how to insert the generated code into a Sheet Cell? ppreciate your support & Help
-
Re: [VB6/VBA] QR Code generator library
Hi There,
I did download the module, but I'm still unable to upload the QR Code into a Sheet Cell. is there a specific vba Code to use with this module?
Appreciate your support & help.