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

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

構文

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

パラメーター

[in] string

型: const WCHAR*

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

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

[in] length

型: INT

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

[in] font

型: const Font*

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

[in, ref] layoutRect

型: const RectF

文字列を囲む四角形への参照。

[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 メソッド

フォント

グラフィックス

RectF