Promotic

fillRect - method of the CanvasCtx object

Description:
Draws a "filled" rectangle.
Syntax:
Object fillRect(Long x, Long y, Long width, Long height)
Parameters:
x(Long) The x-coordinate of the left upper corner of the rectangle
y(Long) The y-coordinate of the left upper corner of the rectangle
width(Long) Width of the rectangle (in pixels).
height(Long) Height of the rectangle (in pixels).
Note:
This method is also functional in Web panels.
See also:
- CanvasCtx.rect (method)
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(50, 50, 150, 80);

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.