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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Dynamically change Images

drieder
15-Moonstone

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
Laurenz
7-Bedrock
(To:drieder)

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.

drieder
15-Moonstone
(To:Laurenz)

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.

Top Tags