font height in Twips?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
If we check Font.Height property it returns the value in pixel. How to
convert the same in Twips?
please guide
 
Twips are 1/20th of a point which is in turn 1/72nd of an inch so take
height in pixels, divide by DPI and multiply by 1440. Remember to cast the
font height to a float otherwise you'll get integer rounding problems. You
can get the DPI from the Graphics object.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top