Convert SizeF to twips

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

The real reason I ask is, I want to compare the size of a winform label with
the size of a crystal field. Crystal uses twips. What units are used in
winforms? Pixels? Points?

Jeremy
 
winforms in .Net use pixels


There are no twips anymore, but 1 twip is still 1/1440 inch

pixels / g.dpix * 1440

paste this in a form and it will work
Private Function fIntPixToTwips(ByVal intValInPix As Integer) As Integer

Dim g As Graphics = Me.CreateGraphics()

fIntPixToTwips = intValInPix / g.dpix * 1440

g.Dispose()

End Function


happy coding :-)

Michel Posseth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top