ez.no / exponential / documentation / development / libraries / ez template / operators / image handling
These documentation pages are no longer maintained. Please visit the new documentation site.
These operators require the ImageMagick and/or ImageGD extension to work.
Creates and returns an image by flattening the image layers given as
parameters. (This requires the ImageMagick or the ImageGD extension.)
If a parameter is text it will be used as the alternative text.
If the parameter is an array it will assume that the first element (0)
is the image layer, and the second is a hash table with parameters for
that layer.
The parameters that can be set are:
- transparency: float value from 0 to 1.0 (ie 0-100%)
- halign: horizontal alignment, use left, right or center
- valign: vertical alignment, use top, bottom or center
- x: absolute placement (works with left and right align)
- y: absolute placement (works with top and bottom align)
- xrel: relative placement, float value from 0 to 1.0. (works with left and right align)
- xrel: relative placement, float value from 0 to 1.0. (works with top and bottom align)
The x and xrel parameters cannot be used at the same time (same with y and yrel).
When right or bottom alignment is used, the coordinate system will shift to accommodate the alignment.
This is useful for doing alignment and placement since the placement is
relative to the current coordinate system. Right alignment will start
the axis at the right (0) and go on to the left (width).
Bottom alignment will start the axis at the bottom (0) and go on to the top (height).
Example:
Merge two images:
{image(imagefile('image1.png'|ezimage),imagefile('image2.png'|ezimage))}
Texttoimage:
{'Exponential'|texttoimage('arial')}
Similar to above but now wrapped in an image object:
{image('Exponential'|texttoimage('arial'))}
Loads image from file to display as layer:
{imagefile('var/cache/texttoimage/church.jpg')}
Creates image object with one file image layer:
{image(imagefile('var/cache/texttoimage/church.jpg'))}
Creates image object with 80% transparent text aligned in the top right corner:
{image("church", imagefile('var/cache/texttoimage/church.jpg'), array('Exponential'|texttoimage, hash(transparency,0.8, halign,right, valign,top)))}
Comments
Tip: Using curly braces
Alex Jones
Tuesday 27 April 2004 8:54:42 pm
{concat('{ ', $node_name, ' }')|texttoimage( 'nav_header' )}
This will not:
{concat('{ ', $node_name, ' }')|wash|texttoimage( 'nav_header' )}
nor will:
{concat('{literal}{{/literal} ', $node_name, ' {literal}}{/literal}')|wash|texttoimage( 'nav_header' )}
Alex
Don't get it..
Thomas Brandl
Wednesday 10 September 2003 3:35:26 pm
{image("church",
church is the layer?
> the second is a hash table for that layer
imagefile('var/cache/texttoimage/church.jpg'),
that seems to be the image layer?!