Multimobile Development: Building Applications for any Smartphone
Bypass Graphics.MeasureString limitations
Details Related Types
Site:  The Code Project
Original URL:  http://www.codeproject.com/csharp/measurestring.asp
Summary:
Graphics.MeasureString can be used to compute the height and width of a text string. Often, however, the dimensions returned do not match the size of what gets drawn on screen when calling Graphics.DrawString. The code I present here can be inserted into any class which needs to compute the real width of a string (shown by the yellow background above).
System.Drawing.Bitmap
System.Drawing.Graphics
System.Drawing.SizeF
Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734