TextRenderer.DrawText 메서드

정의

지정된 디바이스 컨텍스트, 색 및 글꼴을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

오버로드

Name Description
DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Point, Color)

지정된 디바이스 컨텍스트, 글꼴 및 색을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, String, Font, Rectangle, Color, Color, TextFormatFlags)

지정된 디바이스 컨텍스트, 글꼴, 색, 후면 색 및 서식 지정 지침을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, String, Font, Point, Color, Color, TextFormatFlags)

지정된 디바이스 컨텍스트, 글꼴, 색, 후면 색 및 서식 지정 지침을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Point, Color, Color, TextFormatFlags)

지정된 디바이스 컨텍스트, 글꼴, 색, 후면 색 및 서식 지정 지침을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, String, Font, Rectangle, Color, TextFormatFlags)

지정된 디바이스 컨텍스트, 글꼴, 색 및 서식 지정 명령을 사용하여 지정된 범위 내에서 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, String, Font, Rectangle, Color, Color)

지정된 디바이스 컨텍스트, 글꼴, 색 및 후면 색을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, String, Font, Point, Color, TextFormatFlags)

지정된 디바이스 컨텍스트, 글꼴, 색 및 서식 지정 지침을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, String, Font, Point, Color, Color)

지정된 디바이스 컨텍스트, 글꼴, 색 및 후면 색을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Rectangle, Color, Color, TextFormatFlags)

지정된 디바이스 컨텍스트, 글꼴, 색, 후면 색 및 서식 지정 지침을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Rectangle, Color, Color)

지정된 디바이스 컨텍스트, 글꼴, 색 및 후면 색을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Point, Color, TextFormatFlags)

지정된 디바이스 컨텍스트, 글꼴, 색 및 서식 지정 지침을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Point, Color, Color)

지정된 디바이스 컨텍스트, 글꼴, 색 및 후면 색을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, String, Font, Rectangle, Color)

지정된 디바이스 컨텍스트, 글꼴 및 색을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, String, Font, Point, Color)

지정된 디바이스 컨텍스트, 글꼴 및 색을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Rectangle, Color)

지정된 디바이스 컨텍스트, 글꼴 및 색을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Rectangle, Color, TextFormatFlags)

지정된 디바이스 컨텍스트, 글꼴, 색 및 서식 지정 명령을 사용하여 지정된 범위 내에서 지정된 텍스트를 그립니다.

설명

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Point, Color)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴 및 색을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, ReadOnlySpan<char> text, System::Drawing::Font ^ font, System::Drawing::Point pt, System::Drawing::Color foreColor);
public static void DrawText(System.Drawing.IDeviceContext dc, ReadOnlySpan<char> text, System.Drawing.Font font, System.Drawing.Point pt, System.Drawing.Color foreColor);
static member DrawText : System.Drawing.IDeviceContext * ReadOnlySpan<char> * System.Drawing.Font * System.Drawing.Point * System.Drawing.Color -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As ReadOnlySpan(Of Char), font As Font, pt As Point, foreColor As Color)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
ReadOnlySpan<Char>

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

pt
Point

Point 그린 텍스트의 왼쪽 위 모서리를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

예외

dcnull입니다.

적용 대상

DrawText(IDeviceContext, String, Font, Rectangle, Color, Color, TextFormatFlags)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색, 후면 색 및 서식 지정 지침을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, System::String ^ text, System::Drawing::Font ^ font, System::Drawing::Rectangle bounds, System::Drawing::Color foreColor, System::Drawing::Color backColor, System::Windows::Forms::TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, string text, System.Drawing.Font font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Drawing.Color backColor, System.Windows.Forms.TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, string? text, System.Drawing.Font? font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Drawing.Color backColor, System.Windows.Forms.TextFormatFlags flags);
static member DrawText : System.Drawing.IDeviceContext * string * System.Drawing.Font * System.Drawing.Rectangle * System.Drawing.Color * System.Drawing.Color * System.Windows.Forms.TextFormatFlags -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As String, font As Font, bounds As Rectangle, foreColor As Color, backColor As Color, flags As TextFormatFlags)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
String

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

bounds
Rectangle

Rectangle 텍스트의 범위를 나타내는 값입니다.

foreColor
Color

Color 텍스트에 적용할 값입니다.

backColor
Color

Color 가 나타내는 영역에 적용할 값입니다bounds.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

예외

dcnull입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 줍니다 DrawText . 이 예제를 실행하려면 코드를 Windows Form에 붙여넣고 양식의 RenderText8 이벤트 처리기에서 Paint 호출하여 ePaintEventArgs 전달합니다.

private void RenderText8(PaintEventArgs e)
{
    TextFormatFlags flags = TextFormatFlags.Bottom | TextFormatFlags.WordBreak;
    TextRenderer.DrawText(e.Graphics, "This is some text that will display on multiple lines.", this.Font,
        new Rectangle(10, 10, 100, 50), SystemColors.ControlText, SystemColors.ControlDark, flags);
}
Private Sub RenderText8(ByVal e As PaintEventArgs)
    Dim flags As TextFormatFlags = _
        TextFormatFlags.Bottom Or TextFormatFlags.WordBreak
    TextRenderer.DrawText(e.Graphics, _
        "This is some text that will display on multiple lines.", _
        Me.Font, New Rectangle(10, 10, 100, 50), _
        SystemColors.ControlText, SystemColors.ControlDark, flags)

End Sub

설명

매개 변수는 backcolor 매개 변수bounds If .또는 font is forecolor 또는 backcolornull , 각각 내 EmptyDrawText 영역에 적용됩니다. 메서드는 지정된 디바이스 컨텍스트dc에서 현재 선택된 글꼴 또는 색으로 텍스트를 그립니다. 이 forecolor경우 Transparent 텍스트가 그려지지 않습니다.

매개 변수를 사용하는 DrawText 오버로드 중 TextFormatFlags 하나를 사용하여 텍스트를 그리는 방법을 조작할 수 있습니다. 예를 들어 기본 동작은 그리는 텍스트의 TextRenderer 경계 사각형에 안쪽 여백을 추가하여 돌출 문자 모양을 수용하는 것입니다. 이러한 추가 공백 없이 텍스트 줄을 그려야 하는 경우 해당 버전 DrawTextMeasureText 매개 변수를 SizeTextFormatFlags 사용해야 합니다. 예제를 보려면 MeasureText(IDeviceContext, String, Font, Size, TextFormatFlags)를 참조하세요.

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

TextRenderer 플래그를 사용하여 ExpandTabs 기존 탭 정지를 확장할 수 있지만 그리는 텍스트에 탭 정지를 추가하는 것은 지원되지 않습니다.

적용 대상

DrawText(IDeviceContext, String, Font, Point, Color, Color, TextFormatFlags)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색, 후면 색 및 서식 지정 지침을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, System::String ^ text, System::Drawing::Font ^ font, System::Drawing::Point pt, System::Drawing::Color foreColor, System::Drawing::Color backColor, System::Windows::Forms::TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, string text, System.Drawing.Font font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Drawing.Color backColor, System.Windows.Forms.TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, string? text, System.Drawing.Font? font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Drawing.Color backColor, System.Windows.Forms.TextFormatFlags flags);
static member DrawText : System.Drawing.IDeviceContext * string * System.Drawing.Font * System.Drawing.Point * System.Drawing.Color * System.Drawing.Color * System.Windows.Forms.TextFormatFlags -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As String, font As Font, pt As Point, foreColor As Color, backColor As Color, flags As TextFormatFlags)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
String

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

pt
Point

Point 그린 텍스트의 왼쪽 위 모서리를 나타내는 값입니다.

foreColor
Color

Color 텍스트에 적용할 값입니다.

backColor
Color

Color 그린 텍스트의 배경 영역에 적용할 값입니다.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

예외

dcnull입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 줍니다 DrawText . 이 예제를 실행하려면 코드를 Windows Form에 붙여넣고 양식의 RenderText7 이벤트 처리기에서 Paint 호출하여 ePaintEventArgs 전달합니다.

private void RenderText7(PaintEventArgs e)
{
    TextRenderer.DrawText(e.Graphics, "This is some text.", this.Font,
        new Point(10, 10), Color.White, Color.SteelBlue, TextFormatFlags.Default);
}
Private Sub RenderText7(ByVal e As PaintEventArgs)
    TextRenderer.DrawText(e.Graphics, "This is some text.", _
        Me.Font, New Point(10, 10), Color.White, Color.SteelBlue, _
        TextFormatFlags.Default)

End Sub

설명

backcolor 매개 변수는 그린 텍스트를 포함하는 사각형 영역에 적용됩니다. 경우 font 또는 forecolornullEmpty, 각각, DrawText 메서드에서 지정 dc한 디바이스 컨텍스트에서 현재 선택한 글꼴 또는 색에 텍스트를 그립니다. 이 forecolor경우 Transparent 텍스트가 그려지지 않습니다.

매개 변수를 사용하는 DrawText 오버로드 중 TextFormatFlags 하나를 사용하여 텍스트를 그리는 방법을 조작할 수 있습니다. 예를 들어 기본 동작은 그리는 텍스트의 TextRenderer 경계 사각형에 안쪽 여백을 추가하여 돌출 문자 모양을 수용하는 것입니다. 이러한 추가 공백 없이 텍스트 줄을 그려야 하는 경우 해당 버전 DrawTextMeasureText 매개 변수를 SizeTextFormatFlags 사용해야 합니다. 예제를 보려면 MeasureText(IDeviceContext, String, Font, Size, TextFormatFlags)를 참조하세요.

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

TextRenderer 플래그를 사용하여 ExpandTabs 기존 탭 정지를 확장할 수 있지만 그리는 텍스트에 탭 정지를 추가하는 것은 지원되지 않습니다.

메모

그린 텍스트의 왼쪽 위 모서리로 DrawText 지정하는 Point 메서드가 Windows 2000에서 올바르게 렌더링되지 않습니다. 애플리케이션이 Windows 2000을 실행하는 컴퓨터에서 사용하도록 의도된 경우 그린 텍스트의 범위에 대해 DrawText 지정하는 Rectangle 메서드 중 하나를 사용해야 합니다.

적용 대상

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Point, Color, Color, TextFormatFlags)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색, 후면 색 및 서식 지정 지침을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, ReadOnlySpan<char> text, System::Drawing::Font ^ font, System::Drawing::Point pt, System::Drawing::Color foreColor, System::Drawing::Color backColor, System::Windows::Forms::TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, ReadOnlySpan<char> text, System.Drawing.Font? font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Drawing.Color backColor, System.Windows.Forms.TextFormatFlags flags);
static member DrawText : System.Drawing.IDeviceContext * ReadOnlySpan<char> * System.Drawing.Font * System.Drawing.Point * System.Drawing.Color * System.Drawing.Color * System.Windows.Forms.TextFormatFlags -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As ReadOnlySpan(Of Char), font As Font, pt As Point, foreColor As Color, backColor As Color, flags As TextFormatFlags)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
ReadOnlySpan<Char>

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

pt
Point

Point 그린 텍스트의 왼쪽 위 모서리를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

backColor
Color

Color 그린 텍스트의 배경 영역에 적용할 값입니다.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

예외

dcnull입니다.

적용 대상

DrawText(IDeviceContext, String, Font, Rectangle, Color, TextFormatFlags)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색 및 서식 지정 명령을 사용하여 지정된 범위 내에서 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, System::String ^ text, System::Drawing::Font ^ font, System::Drawing::Rectangle bounds, System::Drawing::Color foreColor, System::Windows::Forms::TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, string text, System.Drawing.Font font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Windows.Forms.TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, string? text, System.Drawing.Font? font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Windows.Forms.TextFormatFlags flags);
static member DrawText : System.Drawing.IDeviceContext * string * System.Drawing.Font * System.Drawing.Rectangle * System.Drawing.Color * System.Windows.Forms.TextFormatFlags -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As String, font As Font, bounds As Rectangle, foreColor As Color, flags As TextFormatFlags)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
String

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

bounds
Rectangle

Rectangle 텍스트의 범위를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

예외

dcnull입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 줍니다 DrawText . 이 예제를 실행하려면 코드를 Windows Form에 붙여넣고 양식의 RenderText6 이벤트 처리기에서 Paint 호출하여 ePaintEventArgs 전달합니다.

private void RenderText6(PaintEventArgs e)
{
    TextFormatFlags flags = TextFormatFlags.Bottom | TextFormatFlags.EndEllipsis;
    TextRenderer.DrawText(e.Graphics, "This is some text that will be clipped at the end.", this.Font,
        new Rectangle(10, 10, 100, 50), SystemColors.ControlText, flags);
}
Private Sub RenderText6(ByVal e As PaintEventArgs)
    Dim flags As TextFormatFlags = TextFormatFlags.Bottom Or _
        TextFormatFlags.EndEllipsis
    TextRenderer.DrawText(e.Graphics, _
    "This is some text that will be clipped at the end.", _
    Me.Font, New Rectangle(10, 10, 100, 50), SystemColors.ControlText, flags)

End Sub

설명

경우 font 또는 colornullEmpty, 각각, DrawText 메서드에서 지정 dc한 디바이스 컨텍스트에서 현재 선택한 글꼴 또는 색에 텍스트를 그립니다. 이 forecolor경우 Transparent 텍스트가 그려지지 않습니다.

매개 변수를 사용하는 DrawText 오버로드 중 TextFormatFlags 하나를 사용하여 텍스트를 그리는 방법을 조작할 수 있습니다. 예를 들어 기본 동작은 그리는 텍스트의 TextRenderer 경계 사각형에 안쪽 여백을 추가하여 돌출 문자 모양을 수용하는 것입니다. 이러한 추가 공백 없이 텍스트 줄을 그려야 하는 경우 해당 버전 DrawTextMeasureText 매개 변수를 SizeTextFormatFlags 사용해야 합니다. 예제를 보려면 MeasureText(IDeviceContext, String, Font, Size, TextFormatFlags)를 참조하세요.

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

TextRenderer 플래그를 사용하여 ExpandTabs 기존 탭 정지를 확장할 수 있지만 그리는 텍스트에 탭 정지를 추가하는 것은 지원되지 않습니다.

적용 대상

DrawText(IDeviceContext, String, Font, Rectangle, Color, Color)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색 및 후면 색을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, System::String ^ text, System::Drawing::Font ^ font, System::Drawing::Rectangle bounds, System::Drawing::Color foreColor, System::Drawing::Color backColor);
public static void DrawText(System.Drawing.IDeviceContext dc, string text, System.Drawing.Font font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Drawing.Color backColor);
public static void DrawText(System.Drawing.IDeviceContext dc, string? text, System.Drawing.Font? font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Drawing.Color backColor);
static member DrawText : System.Drawing.IDeviceContext * string * System.Drawing.Font * System.Drawing.Rectangle * System.Drawing.Color * System.Drawing.Color -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As String, font As Font, bounds As Rectangle, foreColor As Color, backColor As Color)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
String

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

bounds
Rectangle

Rectangle 텍스트의 범위를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

backColor
Color

Color 가 나타내는 영역에 적용할 값입니다bounds.

예외

dcnull입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 줍니다 DrawText . 이 예제를 실행하려면 코드를 Windows Form에 붙여넣고 양식의 RenderText4 이벤트 처리기에서 Paint 호출하여 ePaintEventArgs 전달합니다.

private void RenderText4(PaintEventArgs e)
{
    TextRenderer.DrawText(e.Graphics, "Regular Text.", this.Font,
        new Rectangle(10, 10, 70, 70), SystemColors.ControlText, 
        SystemColors.ControlDark);
}
Private Sub RenderText4(ByVal e As PaintEventArgs)
    TextRenderer.DrawText(e.Graphics, "Regular Text.", _
        Me.Font, New Rectangle(10, 10, 70, 70), _
        SystemColors.ControlText, SystemColors.ControlDark)

End Sub

설명

매개 변수는 backColor 매개 변수 내의 영역에 적용됩니다 bounds . font backcolor forecolor 메서드에서 nullEmpty지정 DrawText 한 디바이스 컨텍스트dc에서 현재 선택한 글꼴 또는 색의 텍스트를 그립니다. 이 forecolor경우 Transparent 텍스트가 그려지지 않습니다.

이 메서드는 매개 변수로 지정된 bounds 사각형의 가로 및 세로 가운데에 텍스트를 생성합니다. 텍스트를 그리는 방법을 변경하려면 매개 변수 형식을 사용하는 DrawText 버전을 TextFormatFlags 사용합니다.

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

적용 대상

DrawText(IDeviceContext, String, Font, Point, Color, TextFormatFlags)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색 및 서식 지정 지침을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, System::String ^ text, System::Drawing::Font ^ font, System::Drawing::Point pt, System::Drawing::Color foreColor, System::Windows::Forms::TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, string text, System.Drawing.Font font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Windows.Forms.TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, string? text, System.Drawing.Font? font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Windows.Forms.TextFormatFlags flags);
static member DrawText : System.Drawing.IDeviceContext * string * System.Drawing.Font * System.Drawing.Point * System.Drawing.Color * System.Windows.Forms.TextFormatFlags -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As String, font As Font, pt As Point, foreColor As Color, flags As TextFormatFlags)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
String

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

pt
Point

Point 그린 텍스트의 왼쪽 위 모서리를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

예외

dcnull입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 줍니다 DrawText . 이 예제를 실행하려면 코드를 Windows Form에 붙여넣고 양식의 RenderText5 이벤트 처리기에서 Paint 호출하여 ePaintEventArgs 전달합니다.

private void RenderText5(PaintEventArgs e)
{
    TextRenderer.DrawText(e.Graphics, "Some text.",
        this.Font, new Point(10, 10), SystemColors.ControlText, TextFormatFlags.Bottom);
}
Private Sub RenderText5(ByVal e As PaintEventArgs)
    TextRenderer.DrawText(e.Graphics, "Some text.", _
    Me.Font, New Point(10, 10), SystemColors.ControlText, _
    TextFormatFlags.Bottom)

End Sub

설명

매개 변수를 사용하는 DrawText 오버로드 중 TextFormatFlags 하나를 사용하여 텍스트를 그리는 방법을 조작할 수 있습니다. 예를 들어 기본 동작은 그리는 텍스트의 TextRenderer 경계 사각형에 안쪽 여백을 추가하여 돌출 문자 모양을 수용하는 것입니다. 이러한 추가 공백 없이 텍스트 줄을 그려야 하는 경우 해당 버전 DrawTextMeasureText 매개 변수를 SizeTextFormatFlags 사용해야 합니다. 예제를 보려면 MeasureText(IDeviceContext, String, Font, Size, TextFormatFlags)를 참조하세요.

매개 변수는 backColor 매개 변수 내의 영역에 적용됩니다 bounds . 경우 font 또는 forecolornullColor.Empty, 각각, DrawText 메서드에서 지정 dc한 디바이스 컨텍스트에서 현재 선택한 글꼴 또는 색에 텍스트를 그립니다. 이 forecolor경우 Transparent 텍스트가 그려지지 않습니다.

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

TextRenderer 플래그를 사용하여 ExpandTabs 기존 탭 정지를 확장할 수 있지만 그리는 텍스트에 탭 정지를 추가하는 것은 지원되지 않습니다.

메모

그린 텍스트의 왼쪽 위 모서리로 DrawText 지정하는 Point 메서드가 Windows 2000에서 올바르게 렌더링되지 않습니다. 애플리케이션이 Windows 2000을 실행하는 컴퓨터에서 사용하도록 의도된 경우 그린 텍스트의 범위에 대해 DrawText 지정하는 Rectangle 메서드 중 하나를 사용해야 합니다.

적용 대상

DrawText(IDeviceContext, String, Font, Point, Color, Color)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색 및 후면 색을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, System::String ^ text, System::Drawing::Font ^ font, System::Drawing::Point pt, System::Drawing::Color foreColor, System::Drawing::Color backColor);
public static void DrawText(System.Drawing.IDeviceContext dc, string text, System.Drawing.Font font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Drawing.Color backColor);
public static void DrawText(System.Drawing.IDeviceContext dc, string? text, System.Drawing.Font? font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Drawing.Color backColor);
static member DrawText : System.Drawing.IDeviceContext * string * System.Drawing.Font * System.Drawing.Point * System.Drawing.Color * System.Drawing.Color -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As String, font As Font, pt As Point, foreColor As Color, backColor As Color)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
String

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

pt
Point

Point 그린 텍스트의 왼쪽 위 모서리를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

backColor
Color

Color 그린 텍스트의 배경 영역에 적용할 값입니다.

예외

dcnull입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 줍니다 DrawText . 이 예제를 실행하려면 코드를 Windows Form에 붙여넣고 양식의 RenderText3 이벤트 처리기에서 Paint 호출하여 ePaintEventArgs 전달합니다.

private void RenderText3(PaintEventArgs e)
{
    TextRenderer.DrawText(e.Graphics, "Regular Text", this.Font,
        new Point(10, 10), Color.Red, Color.PowderBlue);
}
Private Sub RenderText3(ByVal e As PaintEventArgs)
    TextRenderer.DrawText(e.Graphics, "Regular Text", Me.Font, _
        New Point(10, 10), Color.Red, Color.PowderBlue)

End Sub

설명

backColor 매개 변수는 그린 텍스트를 포함하는 사각형 영역에 적용됩니다. font backcolor forecolor 메서드에서 nullColor.Empty지정 DrawText 한 디바이스 컨텍스트dc에서 현재 선택한 글꼴 또는 색의 텍스트를 그립니다. 이 forecolor경우 Transparent 텍스트가 그려지지 않습니다.

매개 변수를 사용하는 DrawText 오버로드 중 TextFormatFlags 하나를 사용하여 텍스트를 그리는 방법을 조작할 수 있습니다.

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

메모

그린 텍스트의 왼쪽 위 모서리로 DrawText 지정하는 Point 메서드가 Windows 2000에서 올바르게 렌더링되지 않습니다. 애플리케이션이 Windows 2000을 실행하는 컴퓨터에서 사용하도록 의도된 경우 그린 텍스트의 범위에 대해 DrawText 지정하는 Rectangle 메서드 중 하나를 사용해야 합니다.

적용 대상

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Rectangle, Color, Color, TextFormatFlags)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색, 후면 색 및 서식 지정 지침을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, ReadOnlySpan<char> text, System::Drawing::Font ^ font, System::Drawing::Rectangle bounds, System::Drawing::Color foreColor, System::Drawing::Color backColor, System::Windows::Forms::TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, ReadOnlySpan<char> text, System.Drawing.Font? font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Drawing.Color backColor, System.Windows.Forms.TextFormatFlags flags);
static member DrawText : System.Drawing.IDeviceContext * ReadOnlySpan<char> * System.Drawing.Font * System.Drawing.Rectangle * System.Drawing.Color * System.Drawing.Color * System.Windows.Forms.TextFormatFlags -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As ReadOnlySpan(Of Char), font As Font, bounds As Rectangle, foreColor As Color, backColor As Color, flags As TextFormatFlags)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
ReadOnlySpan<Char>

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

bounds
Rectangle

Rectangle 텍스트의 범위를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

backColor
Color

Color 그린 텍스트의 배경 영역에 적용할 값입니다.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

예외

dcnull입니다.

적용 대상

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Rectangle, Color, Color)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색 및 후면 색을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, ReadOnlySpan<char> text, System::Drawing::Font ^ font, System::Drawing::Rectangle bounds, System::Drawing::Color foreColor, System::Drawing::Color backColor);
public static void DrawText(System.Drawing.IDeviceContext dc, ReadOnlySpan<char> text, System.Drawing.Font? font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Drawing.Color backColor);
static member DrawText : System.Drawing.IDeviceContext * ReadOnlySpan<char> * System.Drawing.Font * System.Drawing.Rectangle * System.Drawing.Color * System.Drawing.Color -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As ReadOnlySpan(Of Char), font As Font, bounds As Rectangle, foreColor As Color, backColor As Color)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
ReadOnlySpan<Char>

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

bounds
Rectangle

Rectangle 텍스트의 범위를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

backColor
Color

Color 그린 텍스트의 배경 영역에 적용할 값입니다.

예외

dcnull입니다.

적용 대상

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Point, Color, TextFormatFlags)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색 및 서식 지정 지침을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, ReadOnlySpan<char> text, System::Drawing::Font ^ font, System::Drawing::Point pt, System::Drawing::Color foreColor, System::Windows::Forms::TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, ReadOnlySpan<char> text, System.Drawing.Font? font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Windows.Forms.TextFormatFlags flags);
static member DrawText : System.Drawing.IDeviceContext * ReadOnlySpan<char> * System.Drawing.Font * System.Drawing.Point * System.Drawing.Color * System.Windows.Forms.TextFormatFlags -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As ReadOnlySpan(Of Char), font As Font, pt As Point, foreColor As Color, flags As TextFormatFlags)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
ReadOnlySpan<Char>

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

pt
Point

Point 그린 텍스트의 왼쪽 위 모서리를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

예외

dcnull입니다.

적용 대상

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Point, Color, Color)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색 및 후면 색을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, ReadOnlySpan<char> text, System::Drawing::Font ^ font, System::Drawing::Point pt, System::Drawing::Color foreColor, System::Drawing::Color backColor);
public static void DrawText(System.Drawing.IDeviceContext dc, ReadOnlySpan<char> text, System.Drawing.Font font, System.Drawing.Point pt, System.Drawing.Color foreColor, System.Drawing.Color backColor);
static member DrawText : System.Drawing.IDeviceContext * ReadOnlySpan<char> * System.Drawing.Font * System.Drawing.Point * System.Drawing.Color * System.Drawing.Color -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As ReadOnlySpan(Of Char), font As Font, pt As Point, foreColor As Color, backColor As Color)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
ReadOnlySpan<Char>

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

pt
Point

Point 그린 텍스트의 왼쪽 위 모서리를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

backColor
Color

Color 그린 텍스트의 배경 영역에 적용할 값입니다.

예외

dcnull입니다.

적용 대상

DrawText(IDeviceContext, String, Font, Rectangle, Color)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴 및 색을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, System::String ^ text, System::Drawing::Font ^ font, System::Drawing::Rectangle bounds, System::Drawing::Color foreColor);
public static void DrawText(System.Drawing.IDeviceContext dc, string text, System.Drawing.Font font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor);
public static void DrawText(System.Drawing.IDeviceContext dc, string? text, System.Drawing.Font? font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor);
static member DrawText : System.Drawing.IDeviceContext * string * System.Drawing.Font * System.Drawing.Rectangle * System.Drawing.Color -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As String, font As Font, bounds As Rectangle, foreColor As Color)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
String

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

bounds
Rectangle

Rectangle 텍스트의 범위를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

예외

dcnull입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 줍니다 DrawText . 이 예제를 실행하려면 코드를 Windows Form에 붙여넣고 양식의 RenderText2 이벤트 처리기에서 Paint 호출하여 ePaintEventArgs 전달합니다.

private void RenderText2(PaintEventArgs e)
{
    TextRenderer.DrawText(e.Graphics, "Regular Text", this.Font,
        new Rectangle(10, 10, 100, 100), SystemColors.ControlText);
}
Private Sub RenderText2(ByVal e As PaintEventArgs)
    TextRenderer.DrawText(e.Graphics, "Regular Text", _
        Me.Font, New Rectangle(10, 10, 100, 100), _
        SystemColors.ControlText)

End Sub

설명

경우 font 또는 forecolornullColor.Empty, 각각, DrawText 메서드에서 지정 dc한 디바이스 컨텍스트에서 현재 선택한 글꼴 또는 색에 텍스트를 그립니다. 이 forecolor경우 Transparent 텍스트가 그려지지 않습니다.

이 메서드는 매개 변수로 지정된 bounds 사각형의 가로 및 세로 가운데에 텍스트를 생성합니다. 텍스트를 그리는 방법을 변경하려면 매개 변수 형식을 사용하는 DrawText 버전을 TextFormatFlags 사용합니다.

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

추가 정보

적용 대상

DrawText(IDeviceContext, String, Font, Point, Color)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴 및 색을 사용하여 지정된 위치에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, System::String ^ text, System::Drawing::Font ^ font, System::Drawing::Point pt, System::Drawing::Color foreColor);
public static void DrawText(System.Drawing.IDeviceContext dc, string text, System.Drawing.Font font, System.Drawing.Point pt, System.Drawing.Color foreColor);
public static void DrawText(System.Drawing.IDeviceContext dc, string? text, System.Drawing.Font? font, System.Drawing.Point pt, System.Drawing.Color foreColor);
static member DrawText : System.Drawing.IDeviceContext * string * System.Drawing.Font * System.Drawing.Point * System.Drawing.Color -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As String, font As Font, pt As Point, foreColor As Color)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
String

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

pt
Point

Point 그린 텍스트의 왼쪽 위 모서리를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

예외

dcnull입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 줍니다 DrawText . 이 예제를 실행하려면 코드를 Windows Form에 붙여넣고 양식의 RenderText1 이벤트 처리기에서 Paint 호출하여 ePaintEventArgs 전달합니다.

private void RenderText1(PaintEventArgs e)
{
    TextRenderer.DrawText(e.Graphics, "Regular Text", this.Font, 
        new Point(10, 10), SystemColors.ControlText);
}
Private Sub RenderText1(ByVal e As PaintEventArgs)
    TextRenderer.DrawText(e.Graphics, "Regular Text", _
        Me.Font, New Point(10, 10), SystemColors.ControlText)

End Sub

설명

매개 변수를 사용하는 DrawText 오버로드 중 TextFormatFlags 하나를 사용하여 텍스트를 그리는 방법을 조작할 수 있습니다.

있는 fontnull 경우 forecolor 메서드는 Color.EmptyDrawText 지정한 디바이스 컨텍스트dc에서 현재 선택된 글꼴 또는 색의 텍스트를 그립니다. 이 forecolor경우 Transparent 텍스트가 그려지지 않습니다.

TextRenderer 클래스에서 제공하는 텍스트 렌더링은 GDI 텍스트 렌더링을 기반으로 하며 Windows Forms 인쇄에 지원되지 않습니다. 대신 클래스의 DrawString 메서드를 Graphics 사용합니다.

메모

그린 텍스트의 왼쪽 위 모서리로 DrawText 지정하는 Point 메서드가 Windows 2000에서 올바르게 렌더링되지 않습니다. 애플리케이션이 Windows 2000을 실행하는 컴퓨터에서 사용하도록 의도된 경우 그린 텍스트의 범위에 대해 DrawText 지정하는 Rectangle 메서드 중 하나를 사용해야 합니다.

추가 정보

적용 대상

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Rectangle, Color)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴 및 색을 사용하여 지정된 범위 내에 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, ReadOnlySpan<char> text, System::Drawing::Font ^ font, System::Drawing::Rectangle bounds, System::Drawing::Color foreColor);
public static void DrawText(System.Drawing.IDeviceContext dc, ReadOnlySpan<char> text, System.Drawing.Font? font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor);
static member DrawText : System.Drawing.IDeviceContext * ReadOnlySpan<char> * System.Drawing.Font * System.Drawing.Rectangle * System.Drawing.Color -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As ReadOnlySpan(Of Char), font As Font, bounds As Rectangle, foreColor As Color)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
ReadOnlySpan<Char>

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

bounds
Rectangle

Rectangle 텍스트의 범위를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

예외

dcnull입니다.

적용 대상

DrawText(IDeviceContext, ReadOnlySpan<Char>, Font, Rectangle, Color, TextFormatFlags)

Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs
Source:
TextRenderer.cs

지정된 디바이스 컨텍스트, 글꼴, 색 및 서식 지정 명령을 사용하여 지정된 범위 내에서 지정된 텍스트를 그립니다.

public:
 static void DrawText(System::Drawing::IDeviceContext ^ dc, ReadOnlySpan<char> text, System::Drawing::Font ^ font, System::Drawing::Rectangle bounds, System::Drawing::Color foreColor, System::Windows::Forms::TextFormatFlags flags);
public static void DrawText(System.Drawing.IDeviceContext dc, ReadOnlySpan<char> text, System.Drawing.Font? font, System.Drawing.Rectangle bounds, System.Drawing.Color foreColor, System.Windows.Forms.TextFormatFlags flags);
static member DrawText : System.Drawing.IDeviceContext * ReadOnlySpan<char> * System.Drawing.Font * System.Drawing.Rectangle * System.Drawing.Color * System.Windows.Forms.TextFormatFlags -> unit
Public Shared Sub DrawText (dc As IDeviceContext, text As ReadOnlySpan(Of Char), font As Font, bounds As Rectangle, foreColor As Color, flags As TextFormatFlags)

매개 변수

dc
IDeviceContext

텍스트를 그릴 디바이스 컨텍스트입니다.

text
ReadOnlySpan<Char>

그릴 텍스트입니다.

font
Font

Font 그린 텍스트에 적용할 값입니다.

bounds
Rectangle

Rectangle 텍스트의 범위를 나타내는 값입니다.

foreColor
Color

Color 그린 텍스트에 적용할 값입니다.

flags
TextFormatFlags

값의 비트 조합입니다 TextFormatFlags .

예외

dcnull입니다.

적용 대상