BitMap TCL UTILITIES USER MANUAL BitMap
SYNOPSIS
Output a bitmap image
PACKAGE
TCLGPH
NAME
BitMap
USAGE
BitMap  wnID X Y Z Just iFile Color {Tag}
INPUT DEFINITIONS
.
wnID - The iD of the window to output the image in.
X - The start X coordinate of the image placement the meaning of which depends on Just
Y - The start Y coordinate of the image placement the meaning of which depends on Just
Z - The start Z coordinate of the image placement the meaning of which depends on Just. This variable is unused with the TK graphics driver but perhaps not with the VTK driver.
Just - The text justification. The possible options are right, center, and left. right centers the left edge of the image at the location (X, Y, Z), center centers the image at (X, Y, Z), and left centers the right edge of the image at (X, Y, Z).
iFile - The image file to output. The file name must be preceded with @
Color - The color of the image. This is an offset into the color table and must be between 0 and 255.
Tag - Optional input variable which allows the image to have the designated Tag attached to it. Tagged items can be selectively deleted from a canvas.
RETURN DEFINITION
NONE
DESCRIPTION
BitMap outputs a bitmap image (.xbm) at the location (X, Y, Z) in the color Color. The image will be started, centered, or end at the location specified depending on if Just is set to right, center, or left respectively.
The graphics package contains a small number internal bitmap images meant to be used as symbols. The file names of the images are contained as a list in the global variable GphInfo(BmPs). The contents of the list is described in the table below.
Symbol List Position File Name
Filled Circle 0 fcirc.xbm
Filled Square 1 fsqr.xbm
Filled Star 2 fstar.xbm
Filled Triangle 3 fstar.xbm
Circle 4 circ.xbm
Square 5 fsqr.xbm
Star 6 fstar.xbm
Triangle 7 fstar.xbm
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1:Examples of various lines.
# INITIALIZE the default gui settings

GUIprefsRead

# SET a window size

set GphInfo(xsScrL) 600
set GphInfo(ysScrL) 500
set GphInfo(xScrL) 600
set GphInfo(yScrL) 500

# INITIALIZE graphics

GraphicsOn TK RainBow SWAP

# SET up a graphics window  on the canvas.

GenWindow  0 0.0 0.0 0.0 1.0 1.0 0.0 -1.0 -1.0 0.0 1.0 1.0 0.0 

# THIS is the number of defined xbm images in TclGPH

set nB [llength $GphInfo(BmPs)]

# RANDOMLY place some bitmap images on a canvas.  The image are randomly
#  selected and the colors are randomly assigned.

for { set I 0 } { $I < 200 } { incr I } { 
   set C [expr int([TUdataRnd1 V 1 P 254])]
   set X [TUdataRnd1 V 1 PN .95]
   set Y [TUdataRnd1 V 1 PN .95]
   set J [expr int([TUdataRnd1 V 1 P 100]) % $nB]

   BitMap 0 $X $Y 0.0 center @[lindex $GphInfo(BmPs) $J] $C
}
      
Feb 22, 2007