closePath - method of the CanvasCtx object
Description:
Connects the path between the last actual drawing point and the first starting point.
Syntax:
Object closePath()
Note:
The method creates a path. Therefore before calling this method the
beginPath method should be called. For the rendering itself the
stroke or
fill method is used.
This method is also functional in
Web panels.
Example:
The
ctx variable represents the drawing canvas (
CanvasCtx). The setup is done on the "
Draw" tab at the beginning of the script of drawing event
onDraw as follows:
var ctx =
pEvent.
GetCtx(1);
JavaScriptSelect and copy to clipboard
ctx.beginPath();
ctx.moveTo(20, 20);
ctx.lineTo(20, 100);
ctx.lineTo(70, 100);
ctx.closePath();
ctx.stroke();