VisualStyleRenderer.GetTextExtent Método

Definición

Devuelve el tamaño y la ubicación de la cadena especificada cuando se dibuja con la fuente del elemento de estilo visual actual.

Sobrecargas

GetTextExtent(IDeviceContext, String, TextFormatFlags)

Devuelve el tamaño y la ubicación de la cadena especificada cuando se dibuja con la fuente del elemento de estilo visual actual.

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

Devuelve el tamaño y la ubicación de la cadena especificada cuando se dibuja con la fuente del elemento de estilo visual actual dentro del rectángulo delimitador inicial especificado.

GetTextExtent(IDeviceContext, String, TextFormatFlags)

Devuelve el tamaño y la ubicación de la cadena especificada cuando se dibuja con la fuente del elemento de estilo visual actual.

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

Parámetros

dc
IDeviceContext

Objeto IDeviceContext que va a utilizar esta operación.

textToDraw
String

La cadena que se va a medir.

flags
TextFormatFlags

Combinación bit a bit de los valores de TextFormatFlags.

Devoluciones

Rectangle

Rectangle que contiene el área requerida para ajustar el texto representado.

Excepciones

dc es null.

Se aplica a

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

Devuelve el tamaño y la ubicación de la cadena especificada cuando se dibuja con la fuente del elemento de estilo visual actual dentro del rectángulo delimitador inicial especificado.

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

Parámetros

dc
IDeviceContext

Objeto IDeviceContext que va a utilizar esta operación.

bounds
Rectangle

Rectangle utilizado para controlar el flujo y ajustar el texto.

textToDraw
String

La cadena que se va a medir.

flags
TextFormatFlags

Combinación bit a bit de los valores de TextFormatFlags.

Devoluciones

Rectangle

Rectangle que contiene el área requerida para ajustar el texto representado.

Excepciones

dc es null.

Se aplica a