Plugin Parameters
plugins
string
Adds a plug-in to the viewer.
If you would like to add specific parameters to the plugins via the fsi-viewer tag, you can do this by prefixing the parameter name with the name of the plug-in, e.g. autospin_enabled="true"
FullScreen Plug-In
Adding the parameter plugins:"FullScreen, Resize"
enables a full screen view option in FSI Viewer. The Resize parameter needs to be set in order to ensure proper adjusting to the full screen.
If the FSI Viewer is embedded in an iFrame, the attribute allowfullscreen="true"
needs to be added to the iFrame. Otherwise, the FullScreen Plug-in will not work due to security restrictions of the browser.
Resize Plug-In
By adding the parameter plugins:"Resize"
the plug-in rearranges the user interface according to the size of the object tag without reloading the entire viewer instance and without the need for client side scripting.
MaxZoom Plug-In
available from version 18.06
By adding the parameter plugins:"maxZoom"
expands the user interface by a button to quickly zoom to the physical resolution of the source image.
ZoomMeter Plug-In
available from version 18.06
Adding the parameter plugins:"ZoomMeter"
extends the navigator window with a display of the current magnification.
The following parameters can be set:
zoomMeter
boolean
trueDefault
Enables or disable the text in the navigation window.
zoomMeter_color
rgb hex
Defines the color of the text in the navigation window.
zoomMeter_decimals
integer
2Default
Defines the color of the text in the navigation window.
zoomMeter_srcRelative
boolean
trueDefault
Display percentage relative to the source image dimension (true
) or relative to the initial image (false
).
AutoSpin Plug-In
available from version 16.09.30
Adding the parameter plugins:"AutoSpin"
enables a button which lets you play/pause the animation that is set with the autospinspeed
parameter.
Parameters are listed as the following in the fsi-viewer tag: autoSpin_Speed, mouseModes_MenuOffset, etc.
The following parameters can be set:
Speed
float
Has the same function as autoSpinSpeed
, but is used here in the context of the plug-in. Time in seconds for a full rotation. Negative values reverse spin direction.
Interval
float
Has the same function as autoSpinInterval
, but is used here in the context of the plug-in.
Can be used instead of autoSpinSpeed
to define the duration of the AutoSpin. autoSpinInterval
defines the pause between every step of the rotation in ms.
Negative values reverse spin direction. The hierarchy of the parameters is as follows:
autoSpin_interval
(Plugin Parameter)autoSpinInterval
(Config Parameter)-
autoSpin_speed
(Plugin Parameter) -
autoSpinSpeed
(Config Parameter)
preventClickZoomWhileSpinning
boolean
falseDefault
Prevents zooming while clicking into the Autospin.
Button
boolean
trueDefault
Enables the Play/ Pause button for the autospin animation.
MouseModes Plug-In
The MouseMode plugin is activated by default with the _default.xml
.
The following parameters can be set:
MenuOffset
integer
0Default
Specifies the space in pixels left of the menu button(s) of the plug-in.
Mode n
boolean
Provides the possibility to hide specific mouse mode buttons.
Mode n | Mouse Mode |
---|---|
Mode0 | Zoom |
Mode1 | Pan |
Mode2 | Rotate 3D (X/Y Axis) |
Sequence
string
0,1,3,2Default
You can alter the sequence of the buttons by providing the modes separated by commas (see the table above).
Example: 1,0,2,3
alters the sequence of the buttons to Pan, Zoom, Rotate 3D, Rotate 2D
.
Measure Plug-In
available from version 18.06.25
Adding the parameter plugins="Measure"
provides an additional button/ mouse-mode which enables the user to measure distances and angles inside the viewer by clicking & dragging. You can list the parameter for the plug-in in the config XML, addressing it with
<plugin src="measure" ImageWidth="2.65" Suffix=" mm" />
or you can list the parameters as the following in the <fsi-viewer>
tag: measure_ImageWidth
, measure_Suffix
, etc.
(Provided the parameter plugins="Measure"
is set in the <fsi-viewer>
tag as well)
Pressing SHIFT locks the angle to 45 degree steps. Pressing CTRL moves the measurement line.
Measuring Mouse Mode
The mouse mode id for the measuring mode is 100. You can use this id to set the InitialMouseMode
parameter of the FSI Viewer. e.g.
<InitialMouseMode value="100" />
The Measure Plug-in requires the real width of the entire image to enable distance measuring.
Example 1:
If you already know the entire width of the image, simply add the ImageWidth
and the Suffix
parameter: If the width of the entire image is 120.5 inches the corresponding tag looks as follows:
<plugin src="measure" ImageWidth="120.5" Suffix=" inches" />
You can also define the plugin parameters directly in the <fsi-viewer>
tag, which could look like this:
<fsi-viewer width="100%" height="100%" src="images/sample.jpg"
skin="white" plugins="Measure" measure_ImageWidth="120.5" measure_Suffix=" inches" />
Example 2:
If you know the width of a part of the image, but you do not know the width of the entire image, you should follow the steps below:
- Add the measure plug-in without any parameters.
- Open the image inside the FSI Viewer and choose the
Measure
mouse mode. - Measure the part of the image you know the real width of. In our example below, we know the width of the notebook is 480mm. The measure plugin will display a value that is our value n.
- Calculate value
w
for theImageWidth
parameter:
Value w calculation | Outcome |
---|---|
- w = real length / n *100. - The Measure plug-in displays n=57.6 - The real length L of the notebook front is 480 mm. - ImageWidth w = L / *100= 480 / 57.6 = 8.33 *100= 833 |
So the plug-in tag would be defined like this:
<plugin src="measure" ImageWidth="833" Suffix=" mm" />
You can also define the plugin parameters directly in the <fsi-viewer>
tag, which could look like this:
<fsi-viewer width="100%" height="100%" src="images/sample.jpg" skin="white"
plugins="Measure" measure_ImageWidth="833" measure_Suffix=" mm" />
The plug-in does not support any perspective correction. This means that measuring scanned maps, diagrams will be accurate, measuring 3 dimensional objects is less accurate.
Measure Parameters
The following attributes can be assigned to the tag. You might as well define all plug-in parameters inside the <fsi-viewer>
tag by using the prefix measure_
with the parameter name, e.g. "measure_ ImageWidth".
ImageWidth
float
100.0Default
Defines the real width of the entire image (e.g. 120 inches). Please see the explanation in the previous section.
Prefix
string
Defines the prefix for the length value e.g. length:
.
Suffix
string
mmDefault
Defines the suffix for the length value e.g. inches
. Usually this is a length unit.
Initial
string
Defines the coordinates of a measure section that is shown initially. Comma seperated string containing x1,y1,x2,y1 [0..1]
coordinates of the image. The values can easily be retrieved using the coords
arguments of the onMeasureEnd
listener.
ShowInAllMouseModes
boolean
falseDefault
Show the measurement in all mouse modes, not just in mouse mode measure
(100).
Decimals
number
1Default
Defines the number of decimals of the length value.
ShowText
boolean
trueDefault
Hides the text displaying the current measurement if set to false
.
ShowAngle
boolean
trueDefault
If set to true the plug-in appends a text representing the current angle in degrees to the text display. E.g. 120.2 inches, 43.2°
.
LineColor
rgb hex
FF0000Default
6-digit hexadecimal color value defining the color of the measure lines.
TextColor
rgb hex
000000Default
6-digit hexadecimal color value defining the color of the text.
TextBorder
rgb hex or false
000000Default
6-digit hexadecimal color value defining the color of the text border. Use false
for no border.
BGColor
rgb hex
FFFFFFDefault
6-digit hexadecimal color value defining the background color of the text.