Share via


IContextNode::GetLocation 메서드

IContextNode 개체의 위치와 크기를 검색합니다.

구문

HRESULT GetLocation(
  [out] IAnalysisRegion **ppIAnalysisRegion
);

매개 변수

ppIAnalysisRegion [out]

IContextNode 개체의 위치 및 크기에 대한 포인터입니다.

반환 값

반환 값에 대한 설명은 클래스 및 인터페이스 - 잉크 분석을 참조하세요.

설명

주의

메모리 누수 방지를 위해 분석 영역을 더 이상 사용할 필요가 없는 경우 *ppIAnalysisRegion에서 IUnknown::Release를 호출합니다.

컨테이너 노드의 위치는 모든 리프 위치의 결합을 찾아 결정됩니다. 잉크 리프 노드의 위치는 연결된 스트로크의 경계 상자의 결합을 찾아 결정합니다. 잉크가 아닌 리프 노드의 위치는 노드를 만들 때 설정되며 IContextNode::SetLocation을 사용하여 업데이트할 수 있습니다.

예제

다음 예제에서는 지정된 노드, 해당 pContextNode 매개 변수에 대한 정보를 검색하는 도우미 메서드를 보여 줍니다. 이 도우미 메서드는 다음 메서드의 정보를 반환합니다.

// Helper method for collecting information about a context node.
HRESULT CMyClass::GetNodeInformation(
    IContextNode *pContextNode,
    GUID *pNodeIdentifier,
    GUID *pContextNodeType,
    IAnalysisRegion **ppAnalysisRegion,
    IContextNode **ppParentNode,
    IContextNodes **ppSubNodes)
{
    // Get the identifier of the context node.
    HRESULT hr = pContextNode->GetId(pNodeIdentifier);

    if (FAILED(hr))
    {
        return hr;
    }

    // Get the type identifier for the context node.
    hr = pContextNode->GetType(pContextNodeType);

    if (FAILED(hr))
    {
        return hr;
    }

    // Get the location of the context node.
    hr = pContextNode->GetLocation(ppAnalysisRegion);

    if (FAILED(hr))
    {
        return hr;
    }

    // Get the parent node of the context node.
    hr = pContextNode->GetParentNode(ppParentNode);

    if (FAILED(hr))
    {
        if ((*ppAnalysisRegion) != NULL)
        {
            (*ppAnalysisRegion)->Release();
            (*ppAnalysisRegion) = NULL;
        }
        return hr;
    }

    // Get the subnodes of the context node.
    hr = pContextNode->GetSubNodes(ppSubNodes);

    if (FAILED(hr))
    {
        if (*ppAnalysisRegion)
        {
            (*ppAnalysisRegion)->Release();
            (*ppAnalysisRegion) = NULL;
        }
        if (*ppParentNode)
        {
            (*ppParentNode)->Release();
            (*ppParentNode) = NULL;
        }
        return hr;
    }

    return hr;
}

요구 사항

요구 사항
지원되는 최소 클라이언트
Windows XP 태블릿 PC 버전 [데스크톱 앱만 해당]
지원되는 최소 서버
지원되는 버전 없음
헤더
IACom.h(IACom_i.c 필요)
DLL
IACom.dll

추가 정보

IContextNode

IAnalysisRegion

IContextNode::SetLocation

잉크 분석 참조