Container Elements: canvas

canvas specifies a canvas container.

The canvas container supports absolute positioning. i.e. objects in a canvas may be freely positioned using the positioning attributes, either with absolute values or using anchors.

Example

<?xml version="1.0"?>
<viewer xmlns="http://issuu.com/viewer/1.0" backgroundColor="#111111">
 
 ...
 
 <canvas horizontalCenter="0" width="200" height="200">
  <image source="#Logo" left="10" top="20"/>
 </canvas>
 
 ...
 
</viewer>

In the example above, the canvas contains an image that is positioned 10 px. from the left edge of the canvas and 20 px. from the top edge of the canvas. The canvas itself is positioned in the center of the Viewer with a size of 200 px. by 200 px.

It is compulsory to specify the size of a canvas.

The canvas element supports all the common attributes.

 

Contents