http://onionworks.net/2006/imageservice/canvas

drawRectangle (canvas : nodeset, rectangle : nodeset, fill : nodeset) : void

With the method “drawRectangle”, a rectangle can be drawn into a picture. The canvas in which drawing is to take place is transferred to the parameter “canvas”. The rectangle to be drawn is transferred to the parameter “rectangle” and the full colour for filling is transferred to the parameter “fill”.

In the following use example, a square with a side length of 100 is now drawn into an existing picture at the position (100,100).

<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:variable name="workspace" select="is:createWorkspace(@src)" />
<xsl:variable name="canvas" select="iscan:createCanvas($workspace)" />
<xsl:variable name="drawEllipse" select="iscan:drawRectangle($canvas, is:createRectangle(100,100,100,100),is:createSolidFill(127,0,0,255))" />
<xsl:variable name="doWrite" select="is:writeWorkspace($workspace, ise:createJpegEncoder(100))" />
<b:output mimeType="image/jpeg">
<b:webResponse expires="60" />
</b:output>
</xsl:template>
</xsl:stylesheet>