A tag defining a single image template. Contains ONE <imgop>, <offset>,
<labe> or a primitive tag.
params:
namethe name of the image template. Must be unique.
bgcolor(optional) HTML color of background
format(optional) Image file format. "gif" or "jpg". Default is "gif"
transparency(optional) if "true" gif transparency is used. bgcolor is set to
transparent.
x(optional) X size of the image. If absent image will be sized to fit
components.
y(optional) Y size of the image. If absent image will be sized to fit
components.
arguments(optional, but highly recommended) listing of the names of arguments that
need to be passed to this image. usually defined as a <param>
tag, not inside the <image ...> tag.
Offset operation. Used to move graphical components over by a set
amount of pixels. The top-left corner of the new area will have coordinates
(0,0) for all the nodes this tag contains. It may contain any number of
graphical nodes, subject to restrictions of its context.
An image operation. The result is a graphical representation of some sort.
Depending on it's type parameter can include anywhere from no to unlimited
amount of other <imgop>'s, <offset>'s, <label>'s and primitives.
Common parameter:
typeDefines what type of operation this <imgop> performs.
Loads an image from a file. The file can be specified using a local path, or
through either an http:// or ftp:// URL. This operation can not contain any
other nodes.
params:
srcThe path of the local file, or the URL of a remote file to retrieve.
base(optional) if present will be pre-pended to the src parameter before trying
to retrieve the file. Use "$img_path" to set the base to the mask
path.
opacity(optional) specifies the alpha value with which to draw the image. (0.0 to
1.0) Default is 1.0
A simple overlay operation. Can contain any number of graphical nodes. Each
one will be drawn on top of the others, in the "bottom-first" order.
Takes no additional parameters.
A simple addition operation. Can contain any number of graphical nodes. Each
one will be arithmetically added to the others. Takes no additional
parameters.
An operation to place a greyscale mask on top of a graphical node. The mask
is used as a gamma adjustmanent layer, darkening some pixcels while making
others lighter. This tag can contain two nodes. The first is a mask and is
required. The second is optional and is the image node that the mask will be
applied to. If it is missing, the image maker will look for a color
parameter, and if this is found, will use a rectangle of tha color to apply
the mask to.
params:
color(optional) the HTML color to apply the mask to if the second child node is
missing.
opacity(optional) specifies the alpha value with which to draw the image. (0.0 to
1.0) Default is 1.0
An operation to place a grayscale mask on top of a graphical node, using the
mask as an alpha adjustment layer. Areas that are white on the mask will be
opaque on the result, and areas that are black will become transparent.
Grey values will be translated into alpha values based on their intensity.
This operation can contain two child nodes. The first is the mask, and the
second is the image source. if the mask is absent, the color parameter is
used, and a rectangle of that color is substituted for the image source.
If both the second parameter and the image source are present, the image
is converted to a monotone palette of the specified color.
params:
color(optional) the HTML color to apply the mask to if the second child node is
missing, or to colorize the image source if both are given.
resize(optional) if equal to "true" the image source will be resized to the
dimensions of the mask.
aspect(optional) indicates whether or not to maintain aspect ratio. can be
"none" (don't maintain), "fit" (resize so all of the image fits)
or "fill" (resize so that all of the mask is filled) Default is
"none".
opacity(optional) specifies the alpha value with which to draw the image. (0.0 to
1.0) Default is 1.0
A node for drawing a text label. This node MUST contain a tag, and
should contain a <font> tag though this is optional.
params:
color(optional) HTML color to use when drawing the text
w(optional) limit the text to some width
h(optional) limit the text to some height
center(optional) if "true" the text will be centered inside the bounding box
specified by h and w (or only one of them if the other is not
supplied)
fit(optional) (optional) if "true", and if any bounds are given (h, w or both) the text
will be sized so that it fits inside these bounds. Otherwise, if
it goes outside hte bounds it is cut off
opacity(optional) specifies the alpha value with which to draw the image. (0.0 to
1.0) Default is 1.0
Running the Test application for image maker:
java psoft.image.Tester xmlfile ["gif"]
where xmlfile is the full path to the xml file containing image template definitions.
Supply the optional "gif" parameter to have the images generated as a gif file, not Jpeg
which is the default. (note that for debug purposes the image maker Tester application
ignores the format parameter of the image as defined in the xml code)