|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectzk.canvas.Canvas
public class Canvas
Utilities to create and manipulate the canvas element.
| 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 |
|---|
public static DOMElement create(int width,
int height)
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);
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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||