Graphics.MeasureString returns different values than Win32 GetTextExtent
问题 i've been trying to find a method in C# to measure the size of a string. The standard method to measure a string in Win32 is to use GetTextExtent. The real goal is to find the average width and height of a font character. The standard method to find the average width of a character starts from getting the width of all alphabetic characters and divide by 52: size = dc.GetTextExtent( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 52); averageWidth = size / 52; Microsoft has a page that