DrawString length

  • Thread starter Thread starter Frecklefoot
  • Start date Start date
F

Frecklefoot

I'm using one of the Graphics.DrawString() methods to draw a string on a
surface. I want to know how long (in pixels) the rendered string will be.
I've looked at the Graphics class, but can't find a method that does this.
Is there a way to determine this?

TIA!
 
Frecklefoot said:
I'm using one of the Graphics.DrawString() methods to draw a string on a
surface. I want to know how long (in pixels) the rendered string will be.
I've looked at the Graphics class, but can't find a method that does this.
Is there a way to determine this?

TIA!

Graphics.MeasureString

You should consider looking over the entire Graphics class on MSDN.

Erik
 
Graphics.MeasureString
You should consider looking over the entire Graphics class on MSDN.

Thanks again (you answered my last post too)! Well, I'm Visual Studio .NET
2003 and have all the docs installed. I looked over the class for facilites
to measure the string length, but somehow I missed it--I hate asking
questions needlessly. But I was looking for functions starting with "Get" or
"String." Next time I'll look more carefully.

Thanks again. :^)
 
Back
Top