Share via


Graphics::MeasureString(constWCHAR*,INT,constFont*,constPointF&,constStringFormat*,RectF*) メソッド (gdiplusgraphics.h)

Graphics::MeasureString メソッドは、指定したフォント、書式、レイアウト四角形の文字列の範囲を測定します。

構文

Status MeasureString(
  [in]      const WCHAR        *string,
  [in]      INT                length,
  [in]      const Font         *font,
  [in, ref] const PointF &     origin,
  [in]      const StringFormat *stringFormat,
  [out]     RectF              *boundingBox
);

パラメーター

[in] string

型: const WCHAR*

測定するワイド文字列へのポインター。

大事な アラビア語などの双方向言語の場合、文字列の長さは 2046 文字を超えてはなりません。
 

[in] length

型: INT

文字列配列内の文字数を指定する整数。 文字列が null で終了する場合は、 length パラメーターを –1 に設定できます。

[in] font

種類: const Font*

文字列に適用されるフォントのファミリ名、サイズ、スタイルを指定する Font オブジェクトへのポインター。

[in, ref] origin

型: const PointF

文字列の開始位置への参照。

[in] stringFormat

型: const StringFormat*

配置、トリミング、タブ位置などのレイアウト情報を指定する StringFormat オブジェクトへのポインター。

[out] boundingBox

種類: RectF*

文字列をバインドする四角形を受け取る RectF オブジェクトへのポインター。

戻り値

種類: 状態

メソッドが成功した場合は、 Status 列挙の要素である OK を返します。

メソッドが失敗した場合は、 Status 列挙体の他の要素のいずれかを返します。

要件

   
サポートされている最小のクライアント Windows XP、Windows 2000 Professional [デスクトップ アプリのみ]
サポートされている最小のサーバー Windows 2000 Server [デスクトップ アプリのみ]
対象プラットフォーム Windows
ヘッダー gdiplusgraphics.h (Gdiplus.h を含む)
Library Gdiplus.lib
[DLL] Gdiplus.dll

こちらもご覧ください

DrawString メソッド

フォント

グラフィックス

Pointf

StringFormat