HighTechTalks DotNet Forums  

Measure the height of wrapped text

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Measure the height of wrapped text in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Samuel
 
Posts: n/a

Default Measure the height of wrapped text - 04-22-2007 , 11:37 AM






I would like to measure the height of wrapped text (of specified font type
and size etc).

I know of the GetHeight method but how can I use it for a number of lines
even if the number of lines is known, I suspect that multiplying the number
of lines by the font height will not return the correct value

Thank you,
Samuel



Reply With Quote
  #2  
Old   
Steve Garrad
 
Posts: n/a

Default Re: Measure the height of wrapped text - 04-22-2007 , 11:49 AM






Try using the System.Drawing.Graphics.measureString method

http://msdn2.microsoft.com/en-us/lib...urestring.aspx

"Samuel" <samuel.shulman (AT) ntlworld (DOT) com> wrote

Quote:
I would like to measure the height of wrapped text (of specified font type
and size etc).

I know of the GetHeight method but how can I use it for a number of lines
even if the number of lines is known, I suspect that multiplying the
number of lines by the font height will not return the correct value

Thank you,
Samuel


Reply With Quote
  #3  
Old   
Samuel
 
Posts: n/a

Default Re: Measure the height of wrapped text - 04-22-2007 , 01:23 PM



Seems more accurate.

Thank you,
Samuel

"Steve Garrad" <stevierg (AT) hot-remove-mail (DOT) com> wrote

Quote:
Try using the System.Drawing.Graphics.measureString method

http://msdn2.microsoft.com/en-us/lib...urestring.aspx

"Samuel" <samuel.shulman (AT) ntlworld (DOT) com> wrote in message
news:u6ofzQPhHHA.4952 (AT) TK2MSFTNGP02 (DOT) phx.gbl...
I would like to measure the height of wrapped text (of specified font type
and size etc).

I know of the GetHeight method but how can I use it for a number of lines
even if the number of lines is known, I suspect that multiplying the
number of lines by the font height will not return the correct value

Thank you,
Samuel




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.