Simulation Model Icon Animations


This document describes one method of attaching icons to objects. See Icons for a general description of all methods.
Instead of animating graphical simulations by simply highlighting the rectangular boxes with colors, you can replace the boxes with arbitrary drawings, -or actual images-, of meaningful objects.

You can do this with the following built-in routines:

  • CSIM_READ_IMAGE - Reads an image into an image data structure.
  • CSIM_SET_IMAGE_ICON - Replaces a named box on your diagram with an image. You use it similar to the highlight_box() function.
  • display_image_resizable - Replaces a named box on your diagram with an image that can be moved or displaced around the screen.
You can graphically show your components in various states by preloading images depicting each state into different image variables at start-up. Then change the component's image according to its state.

A set of network-related icon images is provided with every CSIM distribution under csim/model_libs/icons. You can set your boxes to be displayed in the GUI as an aribtrary icon, by naming an image file under the Properties / Attributes / Icon dialogue.

The following is a detailed description of the image-display routines: