Background processing
With Fyne a lot of image handling is already processing on multiple threads, but that may not be enough for image-intensive applications. In this GoImages app, there are many images being loaded before the user interface is displayed. We can update the image handling to allow the GUI to display faster. To do so, we once again create a new asyncImage type, that loads the image on a background thread before displaying it. Whereas Shiny was passing the images directly to the rendering, here, we are providing them to a canvas.Image object, so the code is slightly different.
We start by creating the basic asyncImage type—its main work is in the load() function, which will run on a background thread. The loadPath() function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access