IDirectManipulationPrimaryContent::SetSnapCoordinate method (directmanipulation.h)
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
[in] motion
One of the values from DIRECTMANIPULATION_MOTION_TYPES.
[in] coordinate
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).
[in] origin
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
Requirement | Value |
---|---|
Minimum supported client | Windows 8 [desktop apps only] |
Minimum supported server | Windows Server 2012 [desktop apps only] |
Target Platform | Windows |
Header | directmanipulation.h |