IStrokeBuilder 인터페이스(rtscom.h)

인터페이스를 사용하여 패킷 데이터에서 스트로크를 프로그래밍 방식으로 만듭니다.

상속

IStrokeBuilder 인터페이스는 IUnknown 인터페이스에서 상속됩니다. IStrokeBuilder 에는 다음과 같은 유형의 멤버도 있습니다.

메서드

IStrokeBuilder 인터페이스에는 이러한 메서드가 있습니다.

 
IStrokeBuilder::AppendPackets

디지타이저 입력 패킷 목록의 끝에 패킷을 추가합니다.
IStrokeBuilder::BeginStroke

RealTimeStylus Class 개체의 패킷 데이터를 사용하여 잉크 개체에 대한 스트로크를 시작합니다.
IStrokeBuilder::CreateStroke

RealTimeStylus 클래스 개체에서 온 패킷 데이터를 사용하여 잉크 개체에 스트로크를 만듭니다.
IStrokeBuilder::EndStroke

스트로크를 종료하고 스트로크 개체를 반환합니다.
IStrokeBuilder::get_Ink

IStrokeBuilder 개체와 연결된 잉크 개체를 가져오거나 설정합니다.

설명

이 인터페이스는 StrokeBuilder 클래스에 의해 구현됩니다.

StrokeBuilder 클래스는 데이터를 관리하는 애플리케이션에 대한 스트로크를 만드는 대체 방법을 제공합니다. StylusDown, 패킷StylusUp 알림에서 호출할 수 있는 메서드가 있습니다.

다음 두 가지 모델이 지원됩니다.

예제

다음 C++ 예제에서는 IStylusPlugin Interface 클래스의 부분 구현을 보여줍니다. 플러그 인은 StrokeBuilder 개체를 사용하여 새 잉크 스트로크를 만듭니다.

// CStrokeBuilderPlugin

// Helper functions
HRESULT CStrokeBuilderPlugin::GetInk(IInkDisp** pInk)
{
	return m_pStrokeBuilder->get_Ink(pInk);
}

// IStylusAsyncPlugin Interface implementation

STDMETHODIMP CStrokeBuilderPlugin::RealTimeStylusEnabled( 
            /* [in] */ IRealTimeStylus *piRtsSrc,
            /* [in] */ ULONG cTcidCount,
            /* [size_is][in] */ const TABLET_CONTEXT_ID *pTcids)
{
	// Create an IStrokeBuilder object
	return CoCreateInstance(CLSID_StrokeBuilder, NULL, CLSCTX_INPROC, IID_IStrokeBuilder, (VOID **)&m_pStrokeBuilder);
}

STDMETHODIMP CStrokeBuilderPlugin::DataInterest( 
            /* [retval][out] */ RealTimeStylusDataInterest *pDataInterest)
{
	// Set up the messages we want to receive
	*pDataInterest = (RealTimeStylusDataInterest)(RTSDI_StylusDown | RTSDI_Packets |
                                                  RTSDI_StylusUp | RTSDI_Error);
	return S_OK;
}

STDMETHODIMP CStrokeBuilderPlugin::StylusDown( 
            /* [in] */ IRealTimeStylus *piRtsSrc,
            /* [in] */ const StylusInfo *pStylusInfo,
            /* [in] */ ULONG cPropCountPerPkt,
            /* [size_is][in] */ LONG *pPacket,
            /* [out][in] */ LONG **ppInOutPkt)
{
	FLOAT fInkToDeviceScaleX;
	FLOAT fInkToDeviceScaleY;
	ULONG cPacketProperties;
	PACKET_PROPERTY* pPacketProperties;

	// Get the info we need to call BeginStroke
	HRESULT hr = piRtsSrc->GetPacketDescriptionData(pStylusInfo->tcid, &fInkToDeviceScaleX, &fInkToDeviceScaleY, 
													&cPacketProperties, &pPacketProperties);

	if (SUCCEEDED(hr))
	{
		// Start creating the stroke
		hr = m_pStrokeBuilder->BeginStroke(pStylusInfo->tcid, pStylusInfo->cid, pPacket, cPropCountPerPkt, 
											pPacketProperties, fInkToDeviceScaleX, fInkToDeviceScaleY, &m_piStroke);
	}
	
	return hr;
}

STDMETHODIMP CStrokeBuilderPlugin::Packets( 
            /* [in] */ IRealTimeStylus *piRtsSrc,
            /* [in] */ const StylusInfo *pStylusInfo,
            /* [in] */ ULONG cPktCount,
            /* [in] */ ULONG cPktBuffLength,
            /* [size_is][in] */ LONG *pPackets,
            /* [out][in] */ ULONG *pcInOutPkts,
            /* [out][in] */ LONG **ppInOutPkts)
{
	// Add packet to the stroke
	return m_pStrokeBuilder->AppendPackets(pStylusInfo->tcid, pStylusInfo->cid, cPktBuffLength, pPackets);
}

STDMETHODIMP CStrokeBuilderPlugin::StylusUp( 
            /* [in] */ IRealTimeStylus *piRtsSrc,
            /* [in] */ const StylusInfo *pStylusInfo,
            /* [in] */ ULONG cPropCountPerPkt,
            /* [size_is][in] */ LONG *pPacket,
            /* [out][in] */ LONG **ppInOutPkt)
{
    // Finish the stroke. This adds the stroke to the StrokeBuilder's Ink object.
    return m_pStrokeBuilder->EndStroke(pStylusInfo->tcid, pStylusInfo->cid, &m_piStroke, NULL);
}

STDMETHODIMP CStrokeBuilderPlugin::Error( 
            /* [in] */ IRealTimeStylus *piRtsSrc,
            /* [in] */ IStylusPlugin *piPlugin,
            /* [in] */ RealTimeStylusDataInterest dataInterest,
            /* [in] */ HRESULT hrErrorCode,
            /* [out][in] */ LONG_PTR *lptrKey)
{
	CString strError;
	strError.Format(L"An error occurred. Error code: %d", hrErrorCode);
	TRACE(strError);
	return S_OK;
}

// The remaining interface methods are not used

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows XP 태블릿 PC 버전 [데스크톱 앱만 해당]
지원되는 최소 서버 지원되는 버전 없음
대상 플랫폼 Windows
헤더 rtscom.h

추가 정보

DynamicRenderer 클래스

IStrokeBuilder 인터페이스

RealTimeStylus 클래스

RealTimeStylus 클래스 및 인터페이스