Promotic

clearRect - method of the CanvasCtx object

Description:
Clears the pixels in specified rectangle
Syntax:
Object clearRect(Long x, Long y, Long width, Long height)
Parameters:
x(Long) The x-coordinate of the left upper corner of the rectangle to clear
y(Long) The y-coordinate of the left upper corner of the rectangle to clear
width(Long) Width of the rectangle to be cleared (in pixels).
height(Long) Height of the rectangle to be cleared (in pixels).
Note:
This method is also functional in Web panels.
See also:
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.fillRect(0, 0, 300, 150);
ctx.clearRect(20, 20, 100, 50);

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

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