The routines described here, map to the screen pixel-for-pixel.
Zooming or changing the window size does not resize the images.
For resizable images, see Resizable Images.
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:
The following is a detailed description of the image-display routines:
The routine returns a pointer to the image. Use as, for example:
int *image_ptr; image_ptr = read_ppm_image( "imagefile.ppm" );(A related alternative routine is, read_bim_image, which reads more compact binary-format images. This routine is intended for use with the iconv image-convertor. The iconv utility converts ppm image files into a binary format.)
The xoffset, and yoffset parameters enable you to specify a screen location for the animation to appear relative to the named box. This allows you to place animations adjacent to a box, or to effectively move the box's symbol around the screen. Normally, you would use a (0.0, 0.0) offset, which places the image's top-left corner at the top-left corner of the box. Positive offsets will move the image down or to the right, respectively.
display_image( "/platoon1/radio8", image_ptr, 0.0, 0.0 );
Note that you can create your own images from live data, perhaps to show algorithmic results, or for other reasons. A full example of this is in demo_exmple/demo2.
Note - The routines above will not resize the images based on
zoom level. I.E. One pixel of original image - equals - one pixel on
display image. Also, they will be erased whenever a screen redraw
occurs, such as during a zoom, pan, or navigation operation.
See also Resizable Images for resizable and persistent image routines.