Forum

Problem with canvas texture

19 December 2015 07:01
Hi,

Recently I have been able to recreate the LCD display of an industrial machine using a canvas texture and B4W to project it on the 3D model screen. The resulting image of the display is composed of several layers of 'png' images using the drawImage() method. It works well with Chrome albeit some slowness during the refresh, but with IE11 and even Firefox there are some troubles.

With Firefox, the console reports: NS_ERROR_NOT_AVAILABLE (seemingly on the first drawImage call) and consequently the LCD display remains black. IE11 has a different error message (from memory: bad property value on the "src" argument of the image), but with the same unsuccessful result.

Are there some notorious problem with theses browsers ? From where could come the trouble ? Is it purely a problem of a too heavy calculation for real time use ?

19 December 2015 10:32
Hi,

This behaviour may be caused by these reasons:

1. The image is not loaded yet when the app is trying to draw it on the canvas
http://stackoverflow.com/questions/17049176/ns-error-not-available-component-is-not-available

or

2. Dimensions of the image are specified as percentage and not pixels or not specified at all.
http://stackoverflow.com/questions/27352528/ns-error-not-available-drawimage-in-firefox

Chrome browser seems to be more forgiving to web developers.
The Founder | Twitter | Facebook | Linkedin
 
Please register or log in to leave a reply.