Previous Page | Next Page

Commands Used with the IMGCTRL, IMGOP and PICFILL Functions

SET_PIXEL



Assigns the pixel value in an image at the specified position
Syntax
Details
Example

Syntax

rc=IMGOP(task-id, 'SET_PIXEL', x, y, red<, green, blue>);

x

is the row location in the image.

Type: Numeric

y

is the column location in the image.

Type: Numeric

red

is either the red value of an RGB image or the pixel value for a CMAP or GRAY image.

Type: Numeric

green

is the green value for an RGB image and is ignored for all other image types.

Type: Numeric

blue

is the blue value for an RGB image and is ignored for all other image types.

Type: Numeric


Details

SET_PIXEL acts on the currently selected image. It can be used with either a new image or an existing image. The colors for a CMAP and an RGB image must be between 0 and 255. If any value is out of range, an error is returned. For a GRAY image, SET_PIXEL returns either 0 or 1 for red.

CAUTION:
Image data can be destroyed.

Use this function carefully, or you can destroy your image data. SET_PIXEL overwrites the image data in memory and thus destroys the original image.  [cautionend]


Example

See the example for CREATE_IMAGE.

Previous Page | Next Page | Top of Page