zk.canvas
Class Canvas

java.lang.Object
  extended by zk.canvas.Canvas

public class Canvas
extends java.lang.Object

Utilities to create and manipulate the canvas element.

Since:
5.0.2

Method Summary
static DOMElement create(int width, int height)
          Creates a canvas element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static DOMElement create(int width,
                                int height)
Creates a canvas element.

For example,


 var main = jq("#main");
 main.append(canvas);
 var canvas = zk.canvas.Canvas.create(main.clientWidth, main.clientHeight);
 var ctx = canvas.getContext("2d");
 ctx.fillStyle = "rgb(200,0,0)";  
 ctx.fillRect (10, 10, 55, 50);  
 
 ctx.fillStyle = "rgba(0, 0, 200, 0.5)";  
 ctx.fillRect (30, 30, 255, 50);
 

Parameters:
width - the width. Ignored if not specified. Notice that it accepts only integer (unlike other DOM element)
height - the height. Ignored if not specified. Notice that it accepts only integer (unlike other DOM element)
Returns:
DOMElement


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo