CustomLineCap::GetBaseInset 方法 (gdiplusheaders.h)

CustomLineCap::GetBaseInset方法會取得基底端點與線條開頭之間的距離。

Syntax

REAL GetBaseInset();

傳回值

類型: REAL

這個方法會傳回基底 inset 值。

備註

基底內集用來分隔基底上限與行開頭。 值為 0 會讓基底上限和線條觸控。 大於 0 的值會以單位為單位插入空格 (,) 行尾與行的開頭之間。

範例

下列範例會建立 CustomLineCap 物件、取得 cap 的基底集,然後建立使用相同基底內集的第二個 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)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

CustomLineCap

LineCap