EasyQRCodeJS icon indicating copy to clipboard operation
EasyQRCodeJS copied to clipboard

The logo flashes when code changing

Open LiYanLance opened this issue 3 years ago • 3 comments

Hi, thanks for the amazing work.

I currently met an issue when trying to use makeCode(text) method on QR code with a logo, the logo flashes as the code changing. Check the link to produce it in codesandbox.

Could you help take a look?

LiYanLance avatar Apr 21 '22 10:04 LiYanLance

Yes, you are right.

Actually makeCode function need to clear the canvas content and repaint, and drawing the logo image is asynchronous.

If you don't want to see flashes while drawing, you can to control and display after rendering is complete. The onRenderingEnd(qrCodeOptions, dataURL) function can let you know that the drawing is done.

ushelp avatar Apr 25 '22 04:04 ushelp

Hey @ushelp , thanks for the response.

display after rendering is complete

sounds not an option to me, since I was trying to use it for fountain code, which makes it never stops rendering new content.

I guess I need to either render the logo myself, or use something else,

LiYanLance avatar Apr 25 '22 09:04 LiYanLance

You can assess whether this will actually affect your rendering(Stop your rendering).

It just let every QRCode image shows at the right time, refreshes/display your qrcode when it's completely done. No block for your fountain code.

ushelp avatar Apr 26 '22 02:04 ushelp

Closed, no comments for a long time.

ushelp avatar Oct 12 '22 11:10 ushelp