http://onionworks.net/2006/imageservice/canvas
drawLines (canvas : nodeset, pointNavigator : nodeset, pen : nodeset) : void
This method makes it possible to draw several lines on the workspace in a single command. The point navigator for the corner points of the lines must be created in the following schema. It is to be noted that the end point of one line is automatically the starting point of the next one.
<xsl:variable name="points">
<point x="300" y="300" />
<point x="100" y="300" />
<point x="100" y="100" />
</xsl:variable>In the following example, several lines are drawn into an existing workspace using the “drawLines” method and then written into the output stream.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ise="http://onionworks.net/2006/imageservice/encoders" xmlns:isc="http://onionworks.net/2006/imageservice/commands" xmlns:iscan="http://onionworks.net/2006/imageservice/canvas" xmlns:is="http://onionworks.net/2006/imageservice" xmlns:b="http://onionworks.net/2004/renderengine/binary" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
<xsl:template match="/resource">
</xsl:stylesheet><xsl:variable name="workspace" select="is:createWorkspace(@src, true())" />
<xsl:variable name="pen" select="is:createPen(is:createColor(255,255,255,255))" />
<xsl:variable name="points">
<point x="300" y="300" />
<point x="100" y="300" />
<point x="100" y="100" />
<point x="300" y="100" />
<point x="300" y="300" />
<point x="400" y="200" />
<point x="400" y="0" />
<point x="200" y="0" />
<point x="100" y="100" />
<point x="300" y="100" />
<point x="400" y="0" />
</xsl:variable><xsl:variable name="drawLines" select="iscan:drawLines(iscan:createCanvas($workspace),$points,$pen)" />
<xsl:variable name="doWrite" select="is:writeWorkspace($workspace, ise:createJpegEncoder(80))" />
<b:output mimeType="{picture/@onion:mimeType}">
</xsl:template><b:webResponse expires="60" />
</b:output>Example