Ask for User Decision from Image

Displays a clickable image to the user which can have user-defined click regions for making a decision.

 

Input Arguments

 

0

File Path or Embedded File

Image File

The file containing the image to display.

1

File Path or Embedded File

Image Map XML File

The path to the XML file containing the click regions for the image (see below).

2

String

Window Caption

The caption for the window displaying the image.

3

Integer

Window Width (0 = default)

The width for the window (in pixels). Use 0 to use the default arbitrary width.

4

Integer

Window Height (0 = default)

The height for the window (in pixels). Use 0 to use

the default arbitrary height.

5

Step ID

Step to jump to if Canceled (-1 will fail step on Cancel)

The step to jump to if the user closes or cancels the dialog.

 

Return Arguments

 

6

String

User Choice

The resulting decision made by the user.

 

Returned Status

 

SUCCESS

The user made a selection.

FAILURE

The image or XML file could not be found, or the user cancelled the dialog (and argument 5 was -1).

 

Remarks

The XML map file defines regions in the image—either 2-point rectangles (top left/bottom right) or polygons—with names. The image is displayed for the user and if they click in a region which is defined in the map, then the window closes and the MP result is the name of the clicked region. If the user cancels, the returned string will be empty.

The format of the XML file is outlined below. Inside the <ImageMap> element are <Region> blocks. The region has one attribute: name, which describes the string returned when that region is clicked. The <Region> block must contain at least two <Point> elements. Each <Point> element has two attributes: x and y, indicating the position in pixels (from the top left of the image) for that vertex of the image map. Any region that has exactly two <Point> elements is assumed to be a rectangular region. Any region with more than two <Point> elements is assumed to be a closed polygon. The opening/closing vertex need not be repeated.

<?xml version=”1.0” encoding=”UTF-8” standalone=”yes”?>

<ImageMap>

<Region name=”1 Point Perpendicular”>

<Point x=”332” y=”140” />

<Point x=”674” y=”425” />

</Region>

<Region name=”Circle Parallel”>

 

<Point x=”685” y=”436” />

<Point x=”822” y=”400” />

<Point x=”971” y=”693” />

</Region>

</ImageMap>