Hi there!
Just ran into this one today, and didnt expect this one to be a problem.
I use the following code to just set a simple background to a canvas element in DashBoard.
Relative path:
var img = 'image/test.png';
ogscript.debug('Image path is: ' + img);
ogscript.setStyle('testCanvas', 'bg-u:'+ img);
So, that works, no problem at all, the folder that has the DashBoard also has a folder called "images" and in there is the "test.png" picture. So use of relative path is fine.
Online URL Path:
var img = 'https://higherlogicdownload.s3.amazonaws.com/ROSSVIDEO/eac0a45b-23a6-41ec-9a70-9a5a76a1caed/UploadedImages/Ross-Logo-Living-Live.png';
ogscript.debug('Image path is: ' + img);
ogscript.setStyle('testCanvas', 'bg-u:'+ img);
Just for fun I wanted to try an online URL (as I have done this in an older version of DashBoard), and just grabbed the URL of hte ROSS logo at the top of this page (at time of writing), and the example above with a URL works just fine.
Absolute path:
But then I want to set the background from a filepicker with an absolute path set, and use that URL to set the background, and, well.. it fails. I created a test folder directly in C: just to to a simple path, and grab the URL from the folder from Windows File Explorer, and append the filename to it. In this case it was: C:/test/test.png
var img = 'C:/test/test.png';
ogscript.debug('Image path is: ' + img);
ogscript.setStyle('testCanvas', 'bg-u:'+ img);
Alas this does not work either... Am I missing something that would make this work?
------------------------------
Aleksander Stalsberg
Lillehammer Icehockey Club
------------------------------