.getprintwidth Method

Function:

Returns the width, in pixels, of the text output that will be produced if the same line is actually printed with the lcd.print method.

Syntax:

lcd.getprintwidth(byref str as string) as word

Returns:

Total width of text output in pixels.

See Also:

Working With Text


Part

Description

str

Text to estimate the output width for.


Details

This method does not produce any output on the display, it merely estimates the width of the text if it was to be printed. The lcd.print method also returns the width of the text in pixels, but this data comes after the printing. Sometimes it is desirable to know the output width for the line of text before printing it, and this method allows you to do so.

The width calculation will be affected by the value of the lcd.texthorizontalspacing property.


.getprintwidth Method

Details