admin管理员组

文章数量:1277333

I've used event to add an image after 5 seconds.

image.add("C:\Users\me\Pictures\1.jpg");

But it doesn't work.

The image won't show after 5 seconds.

Is it possible to show image after run the model running?

[![enter image description here][1]] [1]: .png

I've used event to add an image after 5 seconds.

image.add("C:\Users\me\Pictures\1.jpg");

But it doesn't work.

The image won't show after 5 seconds.

Is it possible to show image after run the model running?

[![enter image description here][1]] [1]: https://i.sstatic/fFvMop6t.png

Share Improve this question asked Feb 25 at 9:59 wickkiQWQwickkiQWQ 211 silver badge3 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

If you add an image, you must also change the index to show it. So after adding, also call myImage.setIndex(1); (assuming you just added a 2nd image).

Also check https://anylogic.help/anylogic/presentation/image.html#dynamic-change

You can achieve this through object visibility. Create a boolean variable with a default value of true. Select the dynamic visibility type in the object's properties and specify the created variable there. In an event, change the variable's value from true to false after 5 seconds. This way, the object (in your case, an image) will disappear after 5 seconds.

本文标签: anylogicHow to add jpg to image after run the modelStack Overflow