%%PageItemTitle%%

VectorDraw Web Library

JsPropertiesExtractor Send comments on this topic.
AttachCanvas Method
See Also  Example
vdWebLibrary Namespace > vdmanager Class : AttachCanvas Method
canvasId
The id of the HTML canvas object that the web control will draw all its entities.
width
Optional.The width of the canvas.If no parameter is used, the default of the selected canvas element width is used.
height
Optional.The height of the canvas.If no parameter is used, the default of the selected canvas element height is used.
bkcolor
Optional. The color of the canvas after it is attached to the vdWeb library. If no parameter is used, the default color will be used, black. Alpha values are ignored.
Assign a canvas object to a new web control. The web control is created automatically. The canvas will be set to the given width and height.

Syntax

JScript 
public function AttachCanvas( 
   canvasId : String,
   width : int,
   height : int,
   bkcolor : Object
) : Object;

Parameters

canvasId
The id of the HTML canvas object that the web control will draw all its entities.
width
Optional.The width of the canvas.If no parameter is used, the default of the selected canvas element width is used.
height
Optional.The height of the canvas.If no parameter is used, the default of the selected canvas element height is used.
bkcolor
Optional. The color of the canvas after it is attached to the vdWeb library. If no parameter is used, the default color will be used, black. Alpha values are ignored.

Return Value

The attached vectordraw control.

Example

C#Copy Code
var vdcanvas; 
function vdrawInitPageLoad() { 
    vdcanvas = vdmanager.AttachCanvas('canvas1', 400, 400, new Array(0, 255, 0)); 
}

Remarks

for completely example

See Also