Promotic
WikipediaLinkedInYoutubeTwitterFacebook

measureText - method of object CanvasCtx

Description:
Returns an object that contains the width of the specified text (in pixels).
Syntax:
measureText(text As Long) As Object
Calling:
ctx.measureText(text).width;
Parameters:
text(Long) Measured text
Note:
The method can also be called in the graphic item events for Web Panels.
See also:
Example:
ctx.font = "30px Arial";
var txt = "Promotic";
ctx.fillText("width:" + ctx.measureText(txt).width, 10, 50);
ctx.fillText(txt, 10, 100);
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice