Share via


VisualStyleRenderer.GetTextExtent 메서드

정의

현재 비주얼 스타일 요소의 글꼴을 사용하여 그릴 때 지정된 문자열의 크기와 위치를 반환합니다.

오버로드

GetTextExtent(IDeviceContext, String, TextFormatFlags)

현재 비주얼 스타일 요소의 글꼴을 사용하여 그릴 때 지정된 문자열의 크기와 위치를 반환합니다.

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

지정된 초기 경계 사각형 내에 현재 비주얼 스타일 요소의 글꼴을 사용하여 그릴 때 지정된 문자열의 크기와 위치를 반환합니다.

GetTextExtent(IDeviceContext, String, TextFormatFlags)

현재 비주얼 스타일 요소의 글꼴을 사용하여 그릴 때 지정된 문자열의 크기와 위치를 반환합니다.

public:
 System::Drawing::Rectangle GetTextExtent(System::Drawing::IDeviceContext ^ dc, System::String ^ textToDraw, System::Windows::Forms::TextFormatFlags flags);
public System.Drawing.Rectangle GetTextExtent (System.Drawing.IDeviceContext dc, string textToDraw, System.Windows.Forms.TextFormatFlags flags);
member this.GetTextExtent : System.Drawing.IDeviceContext * string * System.Windows.Forms.TextFormatFlags -> System.Drawing.Rectangle
Public Function GetTextExtent (dc As IDeviceContext, textToDraw As String, flags As TextFormatFlags) As Rectangle

매개 변수

dc
IDeviceContext

이 작업에서 사용할 IDeviceContext입니다.

textToDraw
String

측정할 문자열입니다.

flags
TextFormatFlags

TextFormatFlags 값의 비트 조합입니다.

반환

Rectangle

렌더링된 텍스트를 맞추는 데 필요한 영역을 포함하는 Rectangle입니다.

예외

dc이(가) null인 경우

적용 대상

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

지정된 초기 경계 사각형 내에 현재 비주얼 스타일 요소의 글꼴을 사용하여 그릴 때 지정된 문자열의 크기와 위치를 반환합니다.

public:
 System::Drawing::Rectangle GetTextExtent(System::Drawing::IDeviceContext ^ dc, System::Drawing::Rectangle bounds, System::String ^ textToDraw, System::Windows::Forms::TextFormatFlags flags);
public System.Drawing.Rectangle GetTextExtent (System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string textToDraw, System.Windows.Forms.TextFormatFlags flags);
member this.GetTextExtent : System.Drawing.IDeviceContext * System.Drawing.Rectangle * string * System.Windows.Forms.TextFormatFlags -> System.Drawing.Rectangle
Public Function GetTextExtent (dc As IDeviceContext, bounds As Rectangle, textToDraw As String, flags As TextFormatFlags) As Rectangle

매개 변수

dc
IDeviceContext

이 작업에서 사용할 IDeviceContext입니다.

bounds
Rectangle

텍스트의 흐름과 줄 바꿈을 제어하는 데 사용되는 Rectangle입니다.

textToDraw
String

측정할 문자열입니다.

flags
TextFormatFlags

TextFormatFlags 값의 비트 조합입니다.

반환

Rectangle

렌더링된 텍스트를 맞추는 데 필요한 영역을 포함하는 Rectangle입니다.

예외

dc이(가) null인 경우

적용 대상