http://onionworks.net/2006/imageservice/canvas
drawLine (canvas : nodeset, startPoint : nodeset, endPoint : nodeset, pen : nodeset) : void
This method makes it possible to draw a line on an existing workspace. The use of the method is shown in the following example.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ise="http://onionworks.net/2006/imageservice/encoders" 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,0,0),1)" />
<xsl:variable name="drawLine" select="iscan:drawLine(iscan:createCanvas($workspace), is:createPoint(100,100),is:createPoint(200,200),$pen)" />
<xsl:variable name="doWrite" select="is:writeWorkspace($workspace, ise:createJpegEncoder(60))" />
<b:output mimeType="{@onion:src.mimeType}">
</xsl:template><b:webResponse expires="60" />
</b:output>Drawing a red line
The line is drawn into the created workspace with the corner points [100,100], [200,200] and the colour red and then written into the output stream.