CustomLineCap::GetBaseInset メソッド (gdiplusheaders.h)

CustomLineCap::GetBaseInset メソッドは、基本キャップから行の先頭までの距離を取得します。

構文

REAL GetBaseInset();

戻り値

種類: REAL

このメソッドは、基本の inset 値を返します。

解説

ベース・インセットは、ベース・キャップを行の先頭から分離するために使用されます。 値が 0 の場合、ベース キャップとライン タッチが作成されます。 0 より大きい値を指定すると、線のキャップと線の始点の間にスペース (単位) が挿入されます。

次の例では、 CustomLineCap オブジェクトを作成し、キャップのベース インセットを取得してから、同じ基本 inset を使用する 2 つ目の CustomLineCap オブジェクトを作成します。

VOID Example_GetBaseInset(HDC hdc)
{
   Graphics graphics(hdc);

   //Create a Path object.
   GraphicsPath capPath;

   //Create a CustomLineCap object, and set its base cap to LineCapRound.
   CustomLineCap custCap(NULL, &capPath, LineCapRound, 5);

   // Get the base inset of custCap.
   REAL baseInset = custCap.GetBaseInset();

   // Create a second CustomLineCap object with the same base inset as the
   // first.
   CustomLineCap insetCap(NULL, &capPath, LineCapRound, baseInset);

   // Create a Pen object and assign insetCap as the custom end cap. 
   // Then draw a line.
   Pen pen(Color(255, 0, 0, 255), 5);
   pen.SetCustomEndCap(&insetCap);
   graphics.DrawLine(&pen, Point(0, 0), Point(100, 100));
}

要件

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

関連項目

CustomLineCap

Linecap