template->ifield -- Add a variable image to a template
int template->image ( int template, float left, float bottom, float width, float height, string name[, int default[, array parameters]] )
This method is used to reserve space for an embedded image on a template. The image to occupy the space is specified at placement time (or by the default value).
template
must be a valid template ID.
bottom
and left
define the location of the image on the template.
width
and height
specify the
resultant size the image will be when placed.
The image is scaled to fit this area.
Note that if the proportions of the image do not match
the proportions of the defined space, the image will appear stretched.
name
is the name of the variable that is used to provide the image ID
at the time of placement.
default
is a default value to use if none is specified at placement time.
If no image is specified at placement time and the default is not specified,
the image is not placed.
The default value and the value passed at placement time must be the image ID of
an embedded image (i.e. such as from jfif_embed()
).
parameters
is an array as described in the parameters documentation.
If omitted, default values are used.
This function was added in version 2.2.
Not much error checking yet. If you supply an invalid image ID, it will probably just bomb.