54 views
in Platform Packages by

Hi,

I found something strange on WebGL platform. Belowing is a demo implemented using Embedded Wizard 12 WebGL platform and run on a Chrome browser. The digit part (5, 6) is a Image view.

Technically, when I change the Bitmap property of the Image, the UI should change the immediately without any transistion effect.
It works as expected on the Studio, but on WebGL, it's slightly different, as you can see what I captured using the camera below, the digit first fade-out and then disappear and then switch to show the new image.
 

How can we avoid this? It's not a big problem, but causing some flicker on the UI.

Kind Regards,

John

1 Answer

0 votes
by

Hello John,

what you observe is a peculiarity of all WebBrowsers. Unlike other target systems, the WebBrowser treats image files asynchronously. When you select a bitmap resource to be displayed in an Image view, and the resource is not yet loaded, then the associated image file is loaded with a delay. This is a common approach of how all WebBrowser resources are treated. The contents are always requested asynchronously.

What can you do?

A workaround for this peculiarity is to 'pre-load' the affected bitmap resources and retain them as long as they will be needed. Try following:

1. in the Application component add a new variable.

2. Configure the data type of the variable to be Resource::Bitmap.

3. Now assign to the variable the bitmap resource you want to retain.

You can repeat this operation for multiple bitmaps.

Other idea: from your screenshot I assume you have multiple bitmaps containing the digits like '5', '6', ... If this is the case, don't use multiple bitmaps. Instead use one bitmap containing all digits as so-called frames. See also Configure a multi-frame bitmap resource. The digits are then stored as frames within the same bitmap. Switching between the frames does not require the loading of new bitmaps anymore. To select the desired frame, see the section Select the frame number of a multi-frame bitmap resource.

Best regards

Paul Banach

by
Hi Paul,
 

Thank you very much!

I created a Bitmap type array, and assign all the Bitmap file I want to retain.   It works very well.

 

Kind Regards,
John

Embedded Wizard Website | Privacy Policy | Imprint

...