Quantcast

Documentation Center

  • Trial Software
  • Product Updates

image

Display RGB image on masked subsystem icon

Syntax

image(a)
image(a, position)
image(a, position, rotation)

Description

image(a) displays the image a, where a is an m-by-n-by-3 array of RGB values. If necessary, use the MATLAB® commands imread and ind2rgb to read and convert bitmap files (such as GIF) to the necessary matrix format.

image(a, position) creates the image at the specified position as follows.

PositionDescription
[x, y, w, h]Position (x, y) and size (w, h) of the image where the position is relative to the lower-left corner of the mask. The image scales to fit the specified size.
'center'Center of the mask
'top-left'Top left corner of the mask, unscaled
'bottom-left'Bottom left corner of the mask, unscaled
'top-right'Top right corner of the mask, unscaled
'bottom-right'Bottom right corner of the mask, unscaled

image(a, position, rotation) allows you to specify whether the image rotates ('on') or remains stationary ('off') as the icon rotates. The default is 'off'.

Examples

The command

image(imread('icon.jpg'))

reads the icon image from a JPEG file named icon.jpg in the MATLAB path.

The following commands read and convert a GIF file, label.gif, to the appropriate matrix format. You can type these commands in the Initialization pane of the Mask Editor.

[data, map]=imread('label.gif');
pic=ind2rgb(data,map);

Then type the command

image(pic)

in the Icon pane of the Mask Editor to read the converted label image.

See Also

|

Was this topic helpful?