The IMAGEVIEWER control is used to display images inside a web page. The image can be rotated, zoomed and translated (that is, moved into a specified direction).
The image formats that can be displayed with the IMAGEVIEWER control depend on the capabilities of your web browser. The following image formats normally work in all browsers: JPEG, GIF and PNG.
You can use the mouse wheel to zoom in and out of the page. When an image is zoomed so that its full content does not fit into the page, you can use the mouse to move another portion of the image into view: press and hold the left mouse button inside the image and then move the mouse.
The following topics are covered below:
1 IMAGE 2 IMAGEURL (U) DYNAMIC 2 IMAGEHEIGHT (I4) 2 IMAGEWIDTH (I4) 2 ROTATION (I4) 2 XCENTER (I4) 2 YCENTER (I4) 2 ZOOMFACTOR (F4)
Element | Description |
---|---|
IMAGEURL |
The path to the image to be displayed. |
IMAGEHEIGHT (*) |
The height of the image in pixels. |
IMAGEWIDTH (*) |
The width of the image in pixels. |
ROTATION |
The rotation parameter in degrees. Valid values: 0, 90, 180 or 270. If using a different value (for example, 45), the values are rounded to the next valid value. |
XCENTER (*) |
The current center point of the image on the x-axis (that is, the position of the corresponding pixel on the x-axis). |
YCENTER (*) |
The current center point of the image on the y-axis (that is, the position of the corresponding pixel on the y-axis). |
ZOOMFACTOR (*) |
The zoom factor of the image inside the image viewer. When setting the zoom factor to 0, the image is zoomed so that it fits completely into the control. A zoom factor of 1.0 shows the image in its original size. |
(*) The marked values are not available at program start.
They are calculated when the image is loaded into the web page. After the image
has been loaded into the web page, the loadmethod
is triggered. This event arrives as *PAGE-EVENT
in the server
page. To get the information of the marked elements back from the page, you
will have to wait for the loadmethod
event to be
triggered by the page. When you use the mouse to move another portion of the
image into view, the page is synchronized with the server by sending the
movemethod
information. When you use the mouse
wheel, the page is synchronized with the server by sending the methods which
have been defined with the zoominmethod
and
zoomoutmethod
properties (see
Properties
below).
An example which shows the usage of the IMAGEVIEWER control is
provided in the Natural for Ajax demos. See the program
CTRIMV-P.NSP
.
Basic | |||
valueprop |
Name of the adapter parameter that provides as value the URL of the image that is shown inside the control. |
Obligatory | |
width |
Width of the control in pixels. |
Optional |
10 20 40 100 300 |
height |
Height of the control in pixels. |
Optional |
10 20 40 100 300 |
colspan |
Column spanning of control. If you use TR table rows then you may sometimes want to control the number of columns your control occupies. By default it is "1" - but you may want to define the control to span over more than one columns. The property only makes sense in table rows that are snychronized within one container (i.e. TR, STR table rows). It does not make sense in ITR rows, because these rows are explicitly not synched. |
Optional |
1 2 3 4 5 50 int-value |
rowspan |
Row spanning of control. If you use TR table rows then you may sometimes want to control the number of rows your control occupies. By default it is "1" - but you may want to define the control to span over more than one columns. The property only makes sense in table rows that are snychronized within one container (i.e. TR, STR table rows). It does not make sense in ITR rows, because these rows are explicitly not synched. |
Optional |
1 2 3 4 5 50 int-value |
withscrollbar |
$en/popupwizard/_attr_withscrollbar$ |
Optional |
true false |
comment |
Comment without any effect on rendering and behaviour. The comment is shown in the layout editor's tree view. |
Optional | |
Binding | |||
valueprop | (already explained above) | ||
titleprop |
Name of the adapter parameter that dynamically defines the title of the control. The title is displayed as tool tip when ther user moves the mouse onto the control. |
Optional | |
loadmethod |
Name of the event that is sent to the adapter when the image is loaded. |
Optional | |
movemethod |
Name of the event that is sent to the adapter when the image is moved in the browser. |
Optional | |
zoominmethod |
Name of the event that is sent to the adapter on zoom in of the image in the browser. |
Optional | |
zoomoutmethod |
Name of the event that is sent to the adapter on zoom out of the image in the browser. |
Optional | |
Natural | |||
njx:natname |
If a Natural variable with a name not valid for Application Designer (for instance #FIELD1) shall be bound to the control, a different name (for instance HFIELD1) can be bound instead. If the original name (in this case #FIELD1) is then specified in this attribute, the original name is generated into the parameter data area of the Natural adapter and a mapping between the two names is generated into the PROCESS PAGE statement of the Natural adapter. This mapping must not break a once defined group structure. If for instance a grid control that is bound to a name of GRID1 contains fields that are bound to FIELD1 and FIELD2 respectively, the corresponding njx:natname values may be #GRID1.#FIELD1 and #GRID1.#FIELD2, but not #GRID1.#FIELD1 and #MYGRID1.#FIELD2. |
Optional | |
njx:natcomment |
The value of this attribute is generated as comment line into the parameter data area of the Natural adapter, before the field name. The Map Converter, for instance, uses this attributes to indicate for a generated statusprop variable to which field the statusprop belongs. |
Optional |