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="" xmlns:ise="" xmlns:iscan="" xmlns:is="" xmlns:b="" xmlns:onion="" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
<xsl:template match="/resource">
<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}">
<b:webResponse expires="60" />
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.