Provides the size, in pixels, of the specified text when drawn with the specified font, using the specified size to create an initial bounding rectangle.
- text
- The text to measure.
- font
- The System.Drawing.Font to apply to the measured text.
- proposedSize
- The System.Drawing.Size of the initial bounding rectangle.
The System.Drawing.Size, in pixels, of text drawn with the specified font.
The TextRenderer.MeasureText(string, System.Drawing.Font, System.Drawing.Size) method uses the proposedSize parameter to indicate the relationship of height to width when determining the text size. When measuring text on a single line, if the proposedSize parameter represents a System.Drawing.Size with a height dimension greater than int.MaxValue, the returned System.Drawing.Size will be adjusted to reflect the actual height of the text.