Margins

ImageMARK supports margins around the background picture that allows comments to exceed the picture bounds.

Margins can be defined at startup with the applet parameter:

<param name="margins" value="top,left,bottom,right,color">

or can be set by the finction setMargings(margins). The function accepts the only string parameter having the following format:

"top,left,bottom,right,color"

where:
  top,left,bottom,right - margins in pixels.
  color - margins color specified as #RRGGBB.

Example:
   setMargins("10,20,10,20,#FFFFFF");

Current margins can be obtained in JavaScript via the function getMargins() which returns margins in the same format.

The rules to remember

When the design is submitted on the server:

When an annotation file with margins is loaded the margins stored in it are appended automatically, i.e. it is assumed that you are using the original background picture without margins in it.

If you're loading a background picture with saved margings and an annotation with margins specify zero margins with the applet parameter:

<param name="margins" value="0,0,0,0">

Margins specified by the applet parameter "margins" are only applied to the picture loaded by the applet parameter "picture" and override margins in annotation if you load one.

If you superimpose (e.g. display in a browser) the original background picture without margins and an annotation image saved with margins position the images accordingly using "margings" passed in the submit request.