DataGridViewCell.MeasureTextHeight 메서드

정의

지정된 텍스트의 높이(픽셀)를 가져옵니다.

오버로드

Name Description
MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags, Boolean)

지정된 특성에 따라 지정된 텍스트의 높이를 픽셀 단위로 가져옵니다. 또한 필요한 너비가 지정된 최대 너비보다 큰지 여부를 나타냅니다.

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags)

지정된 특성에 따라 지정된 텍스트의 높이를 픽셀 단위로 가져옵니다.

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags, Boolean)

Source:
DataGridViewCell.cs
Source:
DataGridViewCell.cs
Source:
DataGridViewCell.cs
Source:
DataGridViewCell.cs
Source:
DataGridViewCell.cs

지정된 특성에 따라 지정된 텍스트의 높이를 픽셀 단위로 가져옵니다. 또한 필요한 너비가 지정된 최대 너비보다 큰지 여부를 나타냅니다.

public:
 static int MeasureTextHeight(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, int maxWidth, System::Windows::Forms::TextFormatFlags flags, [Runtime::InteropServices::Out] bool % widthTruncated);
public static int MeasureTextHeight(System.Drawing.Graphics graphics, string text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags, out bool widthTruncated);
public static int MeasureTextHeight(System.Drawing.Graphics graphics, string? text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags, out bool widthTruncated);
static member MeasureTextHeight : System.Drawing.Graphics * string * System.Drawing.Font * int * System.Windows.Forms.TextFormatFlags * bool -> int
Public Shared Function MeasureTextHeight (graphics As Graphics, text As String, font As Font, maxWidth As Integer, flags As TextFormatFlags, ByRef widthTruncated As Boolean) As Integer

매개 변수

graphics
Graphics

Graphics 텍스트를 렌더링하는 데 사용되는 형식입니다.

text
String

측정할 텍스트입니다.

font
Font

Font 텍스트에 적용된 것입니다.

maxWidth
Int32

텍스트의 최대 너비입니다.

flags
TextFormatFlags

텍스트에 적용할 값의 TextFormatFlags 비트 조합입니다.

widthTruncated
Boolean

true 텍스트의 필요한 너비가 .보다 maxWidth큰 경우로 설정합니다.

반품

텍스트의 높이(픽셀)입니다.

예외

graphicsnull입니다.

-또는-

fontnull입니다.

maxWidth 가 1보다 작습니다.

flags 은 값의 유효한 비트 조합이 TextFormatFlags 아닙니다.

설명

여러 줄이 필요하고 지정된 서식 지정이 허용하는 경우 반환되는 높이가 모든 줄의 결합된 높이입니다.

추가 정보

적용 대상

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags)

Source:
DataGridViewCell.cs
Source:
DataGridViewCell.cs
Source:
DataGridViewCell.cs
Source:
DataGridViewCell.cs
Source:
DataGridViewCell.cs

지정된 특성에 따라 지정된 텍스트의 높이를 픽셀 단위로 가져옵니다.

public:
 static int MeasureTextHeight(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, int maxWidth, System::Windows::Forms::TextFormatFlags flags);
public static int MeasureTextHeight(System.Drawing.Graphics graphics, string text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags);
public static int MeasureTextHeight(System.Drawing.Graphics graphics, string? text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags);
static member MeasureTextHeight : System.Drawing.Graphics * string * System.Drawing.Font * int * System.Windows.Forms.TextFormatFlags -> int
Public Shared Function MeasureTextHeight (graphics As Graphics, text As String, font As Font, maxWidth As Integer, flags As TextFormatFlags) As Integer

매개 변수

graphics
Graphics

Graphics 텍스트를 렌더링하는 데 사용되는 형식입니다.

text
String

측정할 텍스트입니다.

font
Font

Font 텍스트에 적용된 것입니다.

maxWidth
Int32

텍스트의 최대 너비입니다.

flags
TextFormatFlags

텍스트에 적용할 값의 TextFormatFlags 비트 조합입니다.

반품

텍스트의 높이(픽셀)입니다.

예외

graphicsnull입니다.

-또는-

fontnull입니다.

maxWidth 가 1보다 작습니다.

flags 은 값의 유효한 비트 조합이 TextFormatFlags 아닙니다.

설명

여러 줄이 필요하고 지정된 서식 지정이 허용하는 경우 반환되는 높이가 모든 줄의 결합된 높이입니다.

추가 정보

적용 대상