IDirectManipulationPrimaryContent::SetHorizontalAlignment method (directmanipulation.h)

Sets the horizontal alignment of the primary content relative to the viewport.

Syntax

HRESULT SetHorizontalAlignment(
  [in] DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment
);

Parameters

[in] alignment

One or more values from DIRECTMANIPULATION_HORIZONTALALIGNMENT. The default is DIRECTMANIPULATION_HORIZONTALALIGNMENT_NONE.

Note  You cannot combine the following options: DIRECTMANIPULATION_HORIZONTALALIGNMENT_LEFT, DIRECTMANIPULATION-HORIZONTALALIGNMENT_CENTER, DIRECTMANIPULATION_HORIZONTALALIGNMENT_RIGHT. DIRECTMANIPULATION_HORIZONTALALIGNMENT_UNLOCKCENTER can be combined with any option but cannot be configured by itself.
 

Return value

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

Remarks

If you have activated a configuration consisting only of zoom or zoom inertia, specify DIRECTMANIPULATION_HORIZONTALALIGNMENT_UNLOCKCENTER to respect the zoom center point.

Examples

The following example shows one way to this method.

HRESULT hr = pViewport->SetHorizontalAlignment(
    DIRECTMANIPULATION_HORIZONTALALIGNMENT_CENTER | DIRECTMANIPULATION_HORIZONTALALIGNMENT_UNLOCKCENTER);

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

See also

IDirectManipulationPrimaryContent