cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a demo that generates QRCode

JJIAN.21
Associate II

The chip is:STM32F429

When I was using the downloaded QRcode program, I found that the program crashed. The use method is as follows:0693W000007YzIvQAK.png

1 ACCEPTED SOLUTION

Accepted Solutions
Alexandre RENOUX
Principal

Hello JJIAN.2,

I've done a UI example to use the QRCode, you can refer to it.

The example was done for F746-DISCO so the resolution is 480x272. You can adapt accordingly.

Since it's only the UI part, to make it run on a board you need to open your Application Template .touchgfx project in Designer. Click on Edit-> Import GUI -> Browse -> Select the .touchgfx file enclosed.

Hope this will help,

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

View solution in original post

17 REPLIES 17
Alexandre RENOUX
Principal

Hello JJIAN.2,

I've done a UI example to use the QRCode, you can refer to it.

The example was done for F746-DISCO so the resolution is 480x272. You can adapt accordingly.

Since it's only the UI part, to make it run on a board you need to open your Application Template .touchgfx project in Designer. Click on Edit-> Import GUI -> Browse -> Select the .touchgfx file enclosed.

Hope this will help,

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

Thank you very much,I run the code as you said,it worked.

Hi lexandre RENOUX,

There is another problem,when i change the Screen display orientation from portrait to landscape the QRcode display is not normal,just like as below:

normal:0693W000007Z3nTQAS.pngabnormality:

0693W000007Z3o2QAC.pngWhat should i do ?

Hello JJIAN.2,

The fact that it does not work in vertical mode is normal because it's not supported. Since we directly write into the framebuffer, no rotation is done by TouchGFX. When you switch to vertical when the default is horizontal, TouchGFX performs a 90 degrees rotation of the widgets before filling the framebuffer. Why ? Because the framebuffer is still horizontal. The framebuffer is still exactly the same as in horizontal orientation.

If you want to make the QRCode work with vertical orientation, you need to modify the draw function to do the 90 degrees rotation when filling the framebuffer. Here is the code you need to change :

0693W000007ZAM0QAO.pngIt's not that easy to perform but it's definitely doable. I don't have time to give you an example right now and I can't tell you when I will have a working example so you probably need to do it yourself.

/Alexandre

Got it,thank you!

Hi Alexandre

How do I fix the size of the QR code instead of following its size change.

Hello JJIAN.2,

I'm not sure I understand your question. Can you be more precise ?

/Alexandre​

Hi Alexandre

I'm sorry.

here are details:

0693W000007ZIlXQAW.png0693W000007ZIlNQAW.pngi want they are all the same size,no matter what the QR code.

I'm guessing here, but it the size might be calculated from the data that it needs to store. If you want the same size you'd need to know the maximum length of data you want to store and just pad smaller amounts with dummy data (if possible?)