VisualStyleRenderer.GetTextExtent Metoda

Definicja

Zwraca rozmiar i lokalizację określonego ciągu podczas rysowania przy użyciu czcionki bieżącego elementu stylu wizualizacji.

Przeciążenia

GetTextExtent(IDeviceContext, String, TextFormatFlags)

Zwraca rozmiar i lokalizację określonego ciągu podczas rysowania przy użyciu czcionki bieżącego elementu stylu wizualizacji.

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

Zwraca rozmiar i lokalizację określonego ciągu podczas rysowania przy użyciu czcionki bieżącego elementu stylu wizualizacji w określonym początkowym prostokątze ograniczenia.

GetTextExtent(IDeviceContext, String, TextFormatFlags)

Zwraca rozmiar i lokalizację określonego ciągu podczas rysowania przy użyciu czcionki bieżącego elementu stylu wizualizacji.

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

Parametry

dc
IDeviceContext

Ta IDeviceContext operacja będzie używana.

textToDraw
String

Ciąg, którego długość ma zostać określona.

flags
TextFormatFlags

Bitowa kombinacja TextFormatFlags wartości.

Zwraca

Rectangle

Element Rectangle zawierający obszar wymagany do dopasowania renderowanego tekstu.

Wyjątki

dc to null.

Dotyczy

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

Zwraca rozmiar i lokalizację określonego ciągu podczas rysowania przy użyciu czcionki bieżącego elementu stylu wizualizacji w określonym początkowym prostokątze ograniczenia.

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

Parametry

dc
IDeviceContext

Ta IDeviceContext operacja będzie używana.

bounds
Rectangle

Służy Rectangle do sterowania przepływem i zawijaniem tekstu.

textToDraw
String

Ciąg, którego długość ma zostać określona.

flags
TextFormatFlags

Bitowa kombinacja TextFormatFlags wartości.

Zwraca

Rectangle

Element Rectangle zawierający obszar wymagany do dopasowania renderowanego tekstu.

Wyjątki

dc to null.

Dotyczy