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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Dynamically change Images

drieder
16-Pearl

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
10-Marble
(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.

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.

Announcements

Top Tags