_IManipulationEvents::ManipulationCompleted method (manipulations.h)

Handles the event when manipulation or inertia finishes.

Syntax

HRESULT ManipulationCompleted(
  [in] FLOAT x,
  [in] FLOAT y,
  [in] FLOAT cumulativeTranslationX,
  [in] FLOAT cumulativeTranslationY,
  [in] FLOAT cumulativeScale,
  [in] FLOAT cumulativeExpansion,
  [in] FLOAT cumulativeRotation
);

Parameters

[in] x

The origin x-coordinate in user-defined coordinates.

[in] y

The origin y-coordinate in user-defined coordinates.

[in] cumulativeTranslationX

The total translation about the x-axis since the beginning of the manipulation in user-defined coordinates.

[in] cumulativeTranslationY

The total translation about the y-axis since the beginning of the manipulation in user-defined coordinates.

[in] cumulativeScale

The total scale change since the beginning of the manipulation as a percentage of the original size.

[in] cumulativeExpansion

The total expansion change since the beginning of the manipulation in user-defined coordinates.

[in] cumulativeRotation

The total rotation change since the beginning of the manipulation in radians.

Return value

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Remarks

Manipulation events are generated for both the IInertiaProcessor and IManipulationProcessor interfaces. If you are using the values from the TOUCHINPUT structure in calls to ProcessUp, the coordinates will be in hundredths of a pixel.

Note  When using inertia, calls to IInertiaProcessor::Complete can force the current manipulation to be extrapolated resulting in large deltas being passed to the ManipulationCompleted event. To address this issue, perform updates on the completed event in addition to the delta event.
 

Examples

The following code shows an implementation of the ManipulationCompleted method.




HRESULT STDMETHODCALLTYPE CManipulationEventSink::ManipulationCompleted( 
    /* [in] */ FLOAT x,
    /* [in] */ FLOAT y,
    /* [in] */ FLOAT cumulativeTranslationX,
    /* [in] */ FLOAT cumulativeTranslationY,
    /* [in] */ FLOAT cumulativeScale,
    /* [in] */ FLOAT cumulativeExpansion,
    /* [in] */ FLOAT cumulativeRotation)
{
    m_cCompletedEventCount ++;

    m_fX = x;
    m_fY = y;
    m_fCumulativeTranslationX = cumulativeTranslationX;
    m_fCumulativeTranslationY = cumulativeTranslationY;
    m_fCumulativeScale = cumulativeScale;
    m_fCumulativeExpansion = cumulativeExpansion;
    m_fCumulativeRotation = cumulativeRotation;

    // Place your code handler here to do any operations based on the manipulation.

    return S_OK;
}
    
    

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header manipulations.h (include Manipulations.h)

See also

Adding Manipulation Support to Unmanaged Code

Handling Inertia in Unmanaged Code

Methods

_IManipulationEvents