Promotic
WikipediaLinkedInYoutubeTwitterFacebook

clip - method of object CanvasCtx

Description:
The Metoda clip 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:
clip As Object
Calling:
ctx.clip();
Note:
The method can also be called in the graphic item events for Web panels.
Example:
The ctx variable represents the drawing canvas (CanvasCtx). The setup is done on Draw page 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();
PROMOTIC 9.0.0 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice