IDirectManipulationCompositor::AddContent method

Associates content with the compositor, assigns a composition device to the content, and specifies the position of the content in the composition tree relative to other composition visuals.

Syntax


HRESULT AddContent(
  [in]            IDirectManipulationContent *content,
  [in, optional]  IUnknown   device,
  [in]            IUnknown *parentVisual,
  [in]            IUnknown *childVisual
);

Parameters

content [in]

The content to add to the composition tree.

content is placed between parentVisual and childVisual in the composition tree.

device [in, optional]

The device used to compose the content.

Note  device is created by the application.

parentVisual [in]

The parent in the composition tree for the content being added.

parentVisual must also be a parent of childVisual in the composition tree.

childVisual [in]

The child in the composition tree for the content being added.

parentVisual must also be a parent of childVisual in the composition tree.

Return value

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

Remarks

All content, regardless of type, must be added to the compositor. This can be primary content, obtained from the viewport by calling GetPrimaryContent, or secondary content, such as a panning indicator, created by calling CreateContent.

If the application uses a system-provided IDirectManipulationCompositor:

  • device must be an IDCompositionDevice object, and parent and child visuals must be IDCompositionVisual objects.
  • device, parentVisual, and childVisual cannot be NULL.
  • device, parentVisual, and childVisual objects are created and owned by the application.
  • When content is added to the composition tree using this method, the new composition visuals are inserted between parentVisual and childVisual. The new visuals should not be destroyed until they are disassociated from the compositor with RemoveContent.

If the application uses a custom implementation of IDirectManipulationCompositor:

  • device, parentVisual, and childVisual must be a valid type for the compositor. They do not have to be IDCompositionDevice or IDCompositionVisual objects.
  • device, parentVisual, and childVisual can be NULL, depending on the compositor.

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_IDirectManipulationCompositor is defined as 537A0825-0387-4EFA-B62F-71EB1F085A7E

See also

IDirectManipulationCompositor

 

 

Community Additions

ADD
Show:
© 2014 Microsoft