Next / Previous / Contents / TCC Help System / NM Tech homepage

6.4. The canvas bitmap object

A bitmap object on a canvas is shown as two colors, the background color (for 0 data values) and the foreground color (for 1 values).

To create a bitmap object on a canvas C, use:

    id = C.create_bitmap ( x, y, *options ... )

which returns the integer ID number of the image object for that canvas.

The x and y values are the reference point that specifies where the bitmap is placed.

Options include:

anchorThe bitmap is positioned relative to point (x, y). The default is anchor=CENTER, meaning that the bitmap is centered on the (x, y) position. See Section 4.5, “Anchors” for the various anchor option values. For example, if you specify anchor=NE, the bitmap will be positioned so that point (x, y) is located at the northeast (top right) corner of the bitmap.
backgroundThe color that will appear where there are 0 values in the bitmap. The default is background="", meaning transparent.
bitmapThe bitmap to be displayed; see Section 4.7, “Bitmaps”.
foregroundThe color that will appear where there are 1 values in the bitmap. The default is foreground="black".
tagsThe tags to be associated with the object, as a sequence of strings.