Promotic
WikipediaLinkedInYoutubeTwitterFacebook

strokeText - method of the CanvasCtx object

Description:
Strokes the text outline. The default color is black.
Syntax:
Object strokeText(String text, Long x, Long y, [Long maxWidth])
Parameters:
text(String) Rendered text
x(Long) The x-coordinate of the text starting point
y(Long) The y-coordinate of the text starting point
maxWidth[optional] (Long) Maximum allowed font size (in pixels).
Note:
This method is also functional in Web panels. If the text contains a "new line" character then in local application the text will be multi-row, but stays single-row on the web. In order to maintain web and future versions compatibility, "new line" character usage it is not recommended.
See also:
- CanvasCtx.fill (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.font = "30px Arial";
ctx.strokeStyle = "blue";
ctx.strokeText("Promotic", 50, 30);

History:
Pm8.02.06: Created
PROMOTIC 9.0.13 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