public class Canvas
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static DOMElement |
create(int width,
int height)
Creates a canvas element.
|
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)Copyright © 2005-2023 Potix Corporation. All Rights Reserved.