ID2D1SvgElement::InsertChildBefore 方法 (d2d1svg.h)

在 referenceChild 元素之前插入 newChild 作为此元素的子元素。 如果 newChild 元素已有父元素,则作为插入的一部分从此父元素中删除。

语法

HRESULT InsertChildBefore(
  [in]           ID2D1SvgElement *newChild,
  [in, optional] ID2D1SvgElement *referenceChild
);

参数

[in] newChild

类型: ID2D1SvgElement*

要插入的元素。

[in, optional] referenceChild

类型: ID2D1SvgElement*

应在其前面插入子元素的元素。 如果 referenceChild 为 null,则 newChild 将作为最后一个子级放置。 如果 referenceChild 为非 null,则它必须是此元素的直接子元素。

返回值

类型: HRESULT

此方法返回 HRESULT 成功或错误代码。 如果此元素不能接受 newChild 类型的子级,则返回错误。 如果 newChild 是此元素的上级,则返回错误。

要求

要求
目标平台 Windows
标头 d2d1svg.h
DLL Direct2d.dll

另请参阅

ID2D1SvgElement