CustomLineCap::GetBaseInset 方法 (gdiplusheaders.h)
CustomLineCap::GetBaseInset 方法获取底帽到行开头之间的距离。
语法
REAL GetBaseInset();
返回值
类型: REAL
此方法返回基内插值。
注解
基本内插用于将基帽与行的开头分隔开。 值为 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) |
Library | Gdiplus.lib |
DLL | Gdiplus.dll |