Page 1 of 1

Measure text

Posted: Thu Aug 28, 2008 9:00 am
by ChristianH
Is it possible to measure text after rendering?
I have a StiText component where I hold some persons name plus degree:
e.g.

Franz
BINDER-REISINGER, Dr.

If the degree and/or name gets longer it cannot fit into the StiText component and there´s another linebreak:

Franz
BINDER-REISINGER, Dipl.-
Ing.

But I´d like to have follwing output:

Franz
BINDER-REISINGER,
Dipl.-Ing.

So I need to know length of lastname + ", " + degree to insert another "\n" after lastname if needed.
The StiText component should not grow in width, only in height.
In c# there´s a method called TextRenderer.MeasureText, does Stimulsoft Report offer similar method or is there another solution for my problem ?

:shame:

Measure text

Posted: Fri Aug 29, 2008 4:39 am
by Edward
Hello, Christian.

Yes, it is possible in Stimulsoft Reports.Net as well.

In the 2008.1 or earlier versions please use the following static property:

StiReport.MeasureGraphics

in latest prerelease versions:

Stimulsoft.Report.StiReport.GlobalMeasureGraphics.MeasureString()


Thank you.