cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically change Images

Alexandrite

Dynamically change Images

Hello everyone,

 

I am using Images and 3D Images in my experience. Now I would like to change the images during runtime. The current image that should be displayed is a property of one of my things.

 

How can I display the current image of the thing in the Image views of the experience? When selecting the ''currentImage'' property of my thing which has the type IMAGE, the binary of the image is returned (apparently).

 

Any help is appreciated very much!

 

Best Regards,

Dominik

2 REPLIES 2
Highlighted

Re: Dynamically change Images

you can change the image of your widget at runtime and pass it an image from your resources:

something like below should work

var currentId; 
$scope.app.view.Home.wdg["myWidget"].src="app/resources/Uploaded/MyImageSequence_" + currentId + ".png";

 MyImageSequence_" + currentId + ".png";  Is just any image you uploaded, iterated through by an index, changing the filename accordingly (just nameyour images like Image_1.jpg Image_2.jpg ...)

I also noticed that loading images at runtime like that take a long time.

Re: Dynamically change Images

Thank you for your reply.

 

Unfortunately I don't have the images stored on my machine locally. I have a thing from Thingworx bound to my experience which has an image property. Since this image changes frequently (its a camera), I would like to show the current image in the 3D image widget.