Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Measuring text height
Thu, Sep 17 2015 8:45 AMPermanent Link

Matthew Jones

Anyone know how to measure text height in EWB2?

TCanvasElement.MeasureText(const Text: String) sounds promising, but
unfortunately only returns the width. This is because the browser
doesn't offer anything more.

In EWB1, I just had a hidden TLabel and it auto-sized and I read the
height. Seems daft though - is there a better way?

--

Matthew Jones
Thu, Sep 17 2015 8:48 AMPermanent Link

Raul

Team Elevate Team Elevate

On 9/17/2015 8:45 AM, Matthew Jones wrote:
> Anyone know how to measure text height in EWB2?
>

Tim had posted that there are ContentHeight and ContentWidth function in
the global InterfaceManager instance.

Have not used them myself though.

Raul
Thu, Sep 17 2015 9:12 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Anyone know how to measure text height in EWB2?  >>

As Raul indicates, what you want is this method:

InterfaceManager.ContentHeight

http://www.elevatesoft.com/manual?action=viewmethod&id=ewb2&comp=TInterfaceManager&method=ContentHeight

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Sep 17 2015 10:42 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> As Raul indicates, what you want is this method:
>
> InterfaceManager.ContentHeight
>

Thanks both - I knew I'd seen something but couldn't remember the right
words.

--

Matthew Jones
Image