Promotic

clip - method of the CanvasCtx object

Description:
The method demarcates the drawn shape (path). Additional drawing will be displayed only inside the defined shape.
All graphic outside the shape will not be dispayed.
Syntax:
Object clip()
Note:
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.fillStyle = "blue";
ctx.beginPath();
ctx.rect(40, 40, 360, 220);
ctx.fill();
ctx.clip();

ctx.strokeStyle = "#000000";
ctx.lineWidth = 5;
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(400, 300);
ctx.stroke();

History:
Pm8.02.06: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.