Export (0) Print
Expand All

_IManipulationEvents::ManipulationDelta method

Handles events that happen when a manipulated object changes.

Syntax


HRESULT ManipulationDelta(
  [in]  FLOAT x,
  [in]  FLOAT y,
  [in]  FLOAT translationDeltaX,
  [in]  FLOAT translationDeltaY,
  [in]  FLOAT scaleDelta,
  [in]  FLOAT expansionDelta,
  [in]  FLOAT rotationDelta,
  [in]  FLOAT cumulativeTranslationX,
  [in]  FLOAT cumulativeTranslationY,
  [in]  FLOAT cumulativeScale,
  [in]  FLOAT cumulativeExpansion,
  [in]  FLOAT cumulativeRotation
);

Parameters

x [in]

The origin x-coordinate in user-defined coordinates.

y [in]

The origin y-coordinate in user-defined coordinates.

translationDeltaX [in]

The translation change about the x-axis in user-defined coordinates since the last event.

translationDeltaY [in]

The translation change about the y-axis in user-defined coordinates since the last event.

scaleDelta [in]

The scale change since the previous event as a percentage of the previous scale.

expansionDelta [in]

The expansion change since the previous event in user-defined coordinates.

rotationDelta [in]

The rotation change since the previous event in radians.

cumulativeTranslationX [in]

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

cumulativeTranslationY [in]

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

cumulativeScale [in]

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

cumulativeExpansion [in]

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

cumulativeRotation [in]

The 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 ProcessMove, 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 ManipulationDelta method.


HRESULT STDMETHODCALLTYPE CManipulationEventSink::ManipulationDelta( 
    /* [in] */ FLOAT x,
    /* [in] */ FLOAT y,
    /* [in] */ FLOAT translationDeltaX,
    /* [in] */ FLOAT translationDeltaY,
    /* [in] */ FLOAT scaleDelta,
    /* [in] */ FLOAT expansionDelta,
    /* [in] */ FLOAT rotationDelta,
    /* [in] */ FLOAT cumulativeTranslationX,
    /* [in] */ FLOAT cumulativeTranslationY,
    /* [in] */ FLOAT cumulativeScale,
    /* [in] */ FLOAT cumulativeExpansion,
    /* [in] */ FLOAT cumulativeRotation)
{
    m_cDeltaEventCount ++;

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

    return S_OK;
}    
    

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Manipulations.h (include Manipulations.h)

See also

Adding Manipulation Support to Unmanaged Code
Handling Inertia in Unmanaged Code
_IManipulationEvents
Methods

 

 

Community Additions

ADD
Show:
© 2014 Microsoft