VisualStyleRenderer.GetTextExtent メソッド

定義

現在の visual スタイル要素のフォントを使用して、指定した文字列を描画する場合の文字列のサイズおよび位置を返します。

オーバーロード

GetTextExtent(IDeviceContext, String, TextFormatFlags)

現在の visual スタイル要素のフォントを使用して、指定した文字列を描画する場合の文字列のサイズおよび位置を返します。

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

現在の visual スタイル要素のフォントを使用して、指定した文字列を特定の初期外接四角形内に描画する場合の、文字列のサイズおよび位置を返します。

GetTextExtent(IDeviceContext, String, TextFormatFlags)

現在の visual スタイル要素のフォントを使用して、指定した文字列を描画する場合の文字列のサイズおよび位置を返します。

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

例外

dcnullです。

適用対象

GetTextExtent(IDeviceContext, Rectangle, String, TextFormatFlags)

現在の visual スタイル要素のフォントを使用して、指定した文字列を特定の初期外接四角形内に描画する場合の、文字列のサイズおよび位置を返します。

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

例外

dcnullです。

適用対象