Page 2 of 2 FirstFirst 12
Results 41 to 77 of 77

Thread: [VB6/VBA] QR Code generator library

  1. #41

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    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>

  2. #42
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    Re: [VB6/VBA] QR Code generator library

    put text to get qrocde err,why?
    Code:
    text1.text="http://www.baidu.com/34134123412341234341234123412341341341343313123131313k1k3k1k3k1k3k1k3k1k3k1k31k13k13k1"

  3. #43

  4. #44
    New Member
    Join Date
    Nov 2022
    Posts
    2

    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

  5. #45

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by Alan Lamb View Post
    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>

  6. #46
    New Member
    Join Date
    Nov 2023
    Posts
    5

    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

  7. #47

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by Scannia View Post
    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>

  8. #48
    New Member
    Join Date
    Nov 2023
    Posts
    5

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by wqweto View Post
    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.
    Name:  Error.jpg
Views: 1066
Size:  36.3 KB

  9. #49

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    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>

  10. #50
    New Member
    Join Date
    Nov 2023
    Posts
    5

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by wqweto View Post
    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!

  11. #51
    New Member
    Join Date
    Dec 2023
    Posts
    4

    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

  12. #52

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    Re: [VB6/VBA] QR Code generator library

    Can you upload/post here a generated QR barcode which contains problematic spanish special symbols?

  13. #53
    Addicted Member gilman's Avatar
    Join Date
    Jan 2017
    Location
    Bilbao
    Posts
    200

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by imasred View Post
    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.

  14. #54
    New Member
    Join Date
    Dec 2023
    Posts
    4

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by wqweto View Post
    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"
    Attached Images Attached Images  
    Last edited by imasred; Jan 8th, 2024 at 01:22 PM.

  15. #55
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,665

    Re: [VB6/VBA] QR Code generator library

    When I san the code, I get "camión español" ... so something is working...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  16. #56
    New Member
    Join Date
    Dec 2023
    Posts
    4

    Red face Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by techgnome View Post
    When I san the code, I get "camión español" ... so something is working...

    -tg
    the problem was my phone. Sorry.
    Attached Images Attached Images  

  17. #57
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,665

    Re: [VB6/VBA] QR Code generator library

    Font issue? That's ... wow... would not expect that to happen...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  18. #58
    New Member
    Join Date
    Dec 2023
    Posts
    4

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by techgnome View Post
    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

  19. #59
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    609

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by imasred View Post
    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.

  20. #60

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by imasred View Post
    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>

  21. #61
    New Member
    Join Date
    Nov 2023
    Posts
    5

    Re: [VB6/VBA] QR Code generator library

    Hi,
    Is it possible to generate Datamatrix code with this program?

    thank you

  22. #62
    Addicted Member gilman's Avatar
    Join Date
    Jan 2017
    Location
    Bilbao
    Posts
    200

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by Scannia View Post
    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.
    Attached Files Attached Files

  23. #63

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by gilman View Post
    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>

  24. #64
    Addicted Member gilman's Avatar
    Join Date
    Jan 2017
    Location
    Bilbao
    Posts
    200

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by wqweto View Post
    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

  25. #65

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by gilman View Post
    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>

  26. #66
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    610

    Re: [VB6/VBA] QR Code generator library

    I just posted in the codebank code Barcode & QRCode reader using ZXing

  27. #67
    New Member
    Join Date
    Nov 2023
    Posts
    5

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by gilman View Post
    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!

  28. #68
    New Member
    Join Date
    Mar 2024
    Posts
    5

    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?

  29. #69

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    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.

  30. #70
    New Member
    Join Date
    Mar 2024
    Posts
    5

    Re: [VB6/VBA] QR Code generator library

    ok great. It's working now with 1.emf extension. Thanks so much!

  31. #71
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    Re: [VB6/VBA] QR Code generator library

    Quote Originally Posted by saturnian View Post
    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?

  32. #72

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    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>

  33. #73
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    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
    Attached Images Attached Images  
    Last edited by xiaoyao; Jun 18th, 2024 at 06:10 AM.

  34. #74

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    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>

  35. #75
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    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.?
    Last edited by xiaoyao; Jun 18th, 2024 at 10:31 PM.

  36. #76

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,409

    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>

  37. #77
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    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.
    Last edited by Shaggy Hiker; Jun 30th, 2024 at 10:47 AM.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width