Update cookies preferences
Promotic

createLinearGradient - method of the CanvasCtx object

Description:
Creates the gradient object for linear color gradient.
Syntax:
Object createLinearGradient(Long x0, Long y0, Long x1, Long y1)
Parameters:
x0(Long) The x-coordinate of the start point of the gradient
y0(Long) The y-coordinate of the start point of the gradient
x1(Long) The x-coordinate of the end point of the gradient
y1(Long) The y-coordinate of the end point of the gradient
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

var grd = ctx.createLinearGradient(20, 20, 60, 40);
ctx.addColorStop(0, "black");
ctx.addColorStop(1, "white");
ctx.fillStyle = grd;

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

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