IDirectManipulationPrimaryContent::SetSnapCoordinate method

Specifies the coordinate system for snap points or snap intervals.

Syntax


HRESULT SetSnapCoordinate(
  [in]  DIRECTMANIPULATION_MOTION_TYPES motion,
  [in]  DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate,
  [in]  float origin
);

Parameters

motion [in]

One of the values from DIRECTMANIPULATION_MOTION_TYPES.

coordinate [in]

One of the values from DIRECTMANIPULATION_SNAPPOINT_COORDINATE.

If motion is set to translation (DIRECTMANIPULATION_MOTION_TRANSLATEX or DIRECTMANIPULATION_MOTION_TRANSLATEY), all values of DIRECTMANIPULATION_SNAPPOINT_COORDINATE are valid.

If motion is set to DIRECTMANIPULATION_MOTION_ZOOM, only DIRECTMANIPULATION_COORDINATE_ORIGIN of DIRECTMANIPULATION_SNAPPOINT_COORDINATE is valid (origin must be set to 0.0f).

origin [in]

The initial, or starting, snap point. All snap points are relative to this one. Only used when DIRECTMANIPULATION_COORDINATE_ORIGIN is set.

If motion is set to DIRECTMANIPULATION_MOTION_ZOOM, then origin must be set to 0.0f.

Return value

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

Remarks

The origin is relative to the content boundaries. If no boundary has been set (SetContentRect is never called) the default boundaries are (-FLT_MAX, FLT_MAX).

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

DirectManipulation.h

IDL

DirectManipulation.idl

IID

IID_IDirectManipulationPrimaryContent is defined as C12851E4-1698-4625-B9B1-7CA3EC18630B

See also

IDirectManipulationPrimaryContent
SetSnapInterval
SetSnapPoints

 

 

Community Additions

ADD
Show:
© 2014 Microsoft