Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
I would like to set the image source in JS but i can't seem to get it to work. I have tried all of these but non seem to work. But they also do not produce an error in the console.
$scope.view.wdg['image-1']['source'] = 'tech1en.png'; $scope.view.wdg['image-1']['source'] = 'resources/Uploaded/tech1en.png'; $scope.view.wdg['image-1']['source'] = 'app/resources/Uploaded/tech1en.png';If i use an application parameter to store the image source value (and then change that parameter with JS) and link that to the image source in Studio it works but this is an extra step i would like to avoid.
Solved! Go to Solution.
Hi @jmikesell,
Please use the below line to set the image source using JS for a mobile AR experience :
$scope.view.wdg['image-1']['imgsrc'] = 'app/resources/Uploaded/download.jpg';
Let me know if this helps!
I've used this code successfully for setting the source for 3D images in experiences on the HoloLens:
$scope.setWidgetProp("instruction_image", "src", "app/resources/Uploaded/finished.png");
Hope this helps.
Allan
Hi @jmikesell,
Please use the below line to set the image source using JS for a mobile AR experience :
$scope.view.wdg['image-1']['imgsrc'] = 'app/resources/Uploaded/download.jpg';
Let me know if this helps!