Another GDI+ question

  • Thread starter Thread starter Karthik Seetharaman
  • Start date Start date
K

Karthik Seetharaman

Given a string, the font, fontstyle and fontsize how do i calculate the
rectangle that will hold it ?

thanks.
 
Karthik Seetharaman said:
Given a string, the font, fontstyle and fontsize how do i calculate the
rectangle that will hold it ?
Use the method 'Graphics.MeasureString', for a given graphics object
context.
 
hOSAM said:
Use the method 'Graphics.MeasureString', for a given graphics object
context.
Thanks. Can i figure out the font-size for a string given the
measurements where it is supposed to go ? I have a rectangular area the
width and height of which is fixed. I need t fit some strings in to that
area.
 
Hello Karthik,

Check out the StringFormat class in GDI+ which can be used in DrawString
GDI+ function.

Regards,
Sujith.
 
Back
Top