Author Topic: QR experiment  (Read 2738 times)

0 Members and 1 Guest are viewing this topic.

Offline SquirrelMonkey

  • Newbie
  • Posts: 29
  • Youtuber and GIPHY artist
    • View Profile
    • Joluijten.com
QR experiment
« on: January 28, 2022, 02:53:39 pm »
I made a fake QR-code generator, but I want to convert it into a working text to QR-code generator. For this I need to know how QR codes work.

This is all the information I can find:
- A QR code contains position indicators, format information converted into monochrome blocks, data converted into monochrome blocks.
- A higher version of a QR code means a bigger size.
-  There are 4 "error correction levels" (L, M, Q, and H). L has the lowest error correction capability but can contain more data.
- It is also possible to set a mode, like numeric or alphanumeric. The alphanumeric mode indicator (probably for URLs and text) is "0010".
- The QR code also contains a character count indicator. If the QR code is "hello", 5 characters need to be indicated in binary (000000101).
- The version information is stored near two position indicators.
- The format information is also stored near position indicators.

Where can I find more information about where and how to put information in a QR-code?

Code: QB64: [Select]
  1. Line (11, 11)-(46, 46), 15, BF: Line (10, 10)-(47, 47), 1, B ' white square with blue border
  2. Line (12, 12)-(19, 19), 0, B: Line (14, 14)-(17, 17), 0, BF ' square 1
  3. y = 26: Line (12 + y, 12)-(19 + y, 19), 0, B: Line (14 + y, 14)-(17 + y, 17), 0, BF ' square 2
  4. x = 26: Line (12, 12 + x)-(19, 19 + x), 0, B: Line (14, 14 + x)-(17, 17 + x), 0, BF ' square 3
  5.  
  6. ' Here some random fake data
  7. For e = 1 To 9
  8.     For a = 0 To 15
  9.         If Int(Rnd * 2) = 1 Then Circle (21 + a, 11 + e), 0, 0 Else Circle (21 + a, 11 + e), 0, 15
  10.     Next a
  11. For e = 1 To 16
  12.     For a = 0 To 33
  13.         If Int(Rnd * 2) = 1 Then Circle (12 + a, 20 + e), 0, 0 Else Circle (12 + a, 20 + e), 0, 15
  14.     Next a
  15. For e = 1 To 13
  16.     For a = 0 To 24
  17.         If Int(Rnd * 2) = 1 Then Circle (21 + a, 32 + e), 0, 0 Else Circle (21 + a, 32 + e), 0, 15
  18.     Next a
  19.  
  20.  

Offline SquirrelMonkey

  • Newbie
  • Posts: 29
  • Youtuber and GIPHY artist
    • View Profile
    • Joluijten.com
Re: QR experiment
« Reply #1 on: January 28, 2022, 02:58:45 pm »
Found this.