Compositor Class

Definition

Manages the session between an application and the system compositor process.

The Compositor class creates an instance of the Compositor for the application that can be used as a factory for a variety of types in the Windows.UI.Composition namespace spanning the visual layer, effects system and animation system. The Compositor class also manages the lifetime of objects created from the factory.

Equivalent WinUI class: Microsoft.UI.Composition.Compositor.

public ref class Compositor sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772160)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class Compositor sealed : IClosable
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772161)]
class Compositor sealed : IClosable
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
class Compositor sealed : IClosable
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772164)]
class Compositor sealed : IClosable
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772164)]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Composition.ICompositorStatics, 393216, "Windows.Foundation.UniversalApiContract")]
class Compositor sealed : IClosable
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772160)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class Compositor : System.IDisposable
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772161)]
public sealed class Compositor : System.IDisposable
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
public sealed class Compositor : System.IDisposable
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772164)]
public sealed class Compositor : System.IDisposable
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772164)]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Composition.ICompositorStatics), 393216, "Windows.Foundation.UniversalApiContract")]
public sealed class Compositor : System.IDisposable
Public NotInheritable Class Compositor
Implements IDisposable
Inheritance
Compositor
Attributes
Implements

Windows 10 requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The Compositor implicitly synchronizes changes made to associated visuals to ensure they get applied in a transactional manner.

See the Composition UI Overview and Composition Visual Tree Overview for more information.

New instances of Compositor must be created on a thread that has a CoreDispatcher.

Version history

Windows version SDK version Value added
1607 14393 CreateAmbientLight
1607 14393 CreateAnimationGroup
1607 14393 CreateBackdropBrush
1607 14393 CreateDistantLight
1607 14393 CreateDropShadow
1607 14393 CreateImplicitAnimationCollection
1607 14393 CreateLayerVisual
1607 14393 CreateMaskBrush
1607 14393 CreateNineGridBrush
1607 14393 CreatePointLight
1607 14393 CreateSpotLight
1607 14393 CreateStepEasingFunction
1607 14393 CreateStepEasingFunction(Int32)
1703 15063 CreateHostBackdropBrush
1709 16299 CreateColorGradientStop
1709 16299 CreateColorGradientStop(Single,Color)
1709 16299 CreateLinearGradientBrush
1709 16299 CreateSpringScalarAnimation
1709 16299 CreateSpringVector2Animation
1709 16299 CreateSpringVector3Animation
1803 17134 Comment
1803 17134 CreateBounceScalarAnimation
1803 17134 CreateBounceVector2Animation
1803 17134 CreateBounceVector3Animation
1803 17134 CreateContainerShape
1803 17134 CreateEllipseGeometry
1803 17134 CreateLineGeometry
1803 17134 CreatePathGeometry
1803 17134 CreatePathGeometry(CompositionPath)
1803 17134 CreatePathKeyFrameAnimation
1803 17134 CreateRectangleGeometry
1803 17134 CreateRoundedRectangleGeometry
1803 17134 CreateShapeVisual
1803 17134 CreateSpriteShape
1803 17134 CreateSpriteShape(CompositionGeometry)
1803 17134 CreateViewBox
1803 17134 GlobalPlaybackRate
1803 17134 MaxGlobalPlaybackRate
1803 17134 MinGlobalPlaybackRate
1803 17134 RequestCommitAsync
1809 17763 CreateBooleanKeyFrameAnimation
1809 17763 CreateGeometricClip
1809 17763 CreateGeometricClip(CompositionGeometry)
1809 17763 CreateRedirectVisual
1809 17763 CreateRedirectVisual(Visual)
1903 18362 CreateProjectedShadow
1903 18362 CreateProjectedShadowCaster
1903 18362 CreateProjectedShadowReceiver
1903 18362 CreateRadialGradientBrush
1903 18362 CreateVisualSurface

Constructors

Compositor()

Creates an instance of Compositor.

Equivalent WinUI constructor: Microsoft.UI.Composition.Compositor.Compositor.

Properties

Comment

Gets or sets a string to associate with the Compositor.

Equivalent WinUI property: Microsoft.UI.Composition.Compositor.Comment.

DefaultGraphicsDevice

Gets the default graphics device.

GlobalPlaybackRate

Gets or sets the rate at which animation plays for all KeyFrame animations created by this compositor.

Equivalent WinUI property: Microsoft.UI.Composition.Compositor.GlobalPlaybackRate.

MaxGlobalPlaybackRate

Gets the maximum allowed playback rate for all KeyFrame animations created by this compositor..

Equivalent WinUI property: Microsoft.UI.Composition.Compositor.MaxGlobalPlaybackRate.

MinGlobalPlaybackRate

Gets the minimum allowed playback rate for all KeyFrame animations created by this compositor.

Equivalent WinUI property: Microsoft.UI.Composition.Compositor.MinGlobalPlaybackRate.

Methods

Close()

Closes the Compositor object and releases system resources.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.Close.

CreateAmbientLight()

Creates an instance of AmbientLight.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateAmbientLight.

CreateAnimationGroup()

Creates an instance of CompositionAnimationGroup.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateAnimationGroup.

CreateBackdropBrush()

Creates an instance of CompositionBackdropBrush.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateBackdropBrush.

CreateBooleanKeyFrameAnimation()

Creates an instance of BooleanKeyFrameAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateBooleanKeyFrameAnimation.

CreateBounceScalarAnimation()

Creates an instance of BounceScalarNaturalMotionAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateBounceScalarAnimation.

CreateBounceVector2Animation()

Creates an instance of BounceVector2NaturalMotionAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateBounceVector2Animation.

CreateBounceVector3Animation()

Creates an instance of BounceVector3NaturalMotionAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateBounceVector3Animation.

CreateColorBrush()

Creates an instance of CompositionColorBrush.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateColorBrush.

CreateColorBrush(Color)

Creates an instance of CompositionColorBrush using the specified color.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateColorBrush.

CreateColorGradientStop()

Creates an instance of CompositionColorGradientStop.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateColorGradientStop.

CreateColorGradientStop(Single, Color)

Creates an instance of CompositionColorGradientStop with the specified offset and color.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateColorGradientStop.

CreateColorKeyFrameAnimation()

Creates an instance of ColorKeyFrameAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateColorKeyFrameAnimation.

CreateContainerShape()

Creates an instance of CompositionContainerShape.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateContainerShape.

CreateContainerVisual()

Creates an instance of ContainerVisual.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateContainerVisual.

CreateCubicBezierEasingFunction(Vector2, Vector2)

Creates an instance of CubicBezierEasingFunction.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateCubicBezierEasingFunction.

CreateDistantLight()

Creates an instance of DistantLight.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateDistantLight.

CreateDropShadow()

Creates an instance of DropShadow.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateDropShadow.

CreateEffectFactory(IGraphicsEffect)

Creates an instance of CompositionEffectFactory.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateEffectFactory.

CreateEffectFactory(IGraphicsEffect, IEnumerable<String>)

Creates an instance of CompositionEffectFactory specifying effect parameters that should be animatable.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateEffectFactory.

CreateEffectVisual()

Creates an instance of EffectVisual.

CreateEllipseGeometry()

Creates an instance of CompositionEllipseGeometry.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateEllipseGeometry.

CreateExpressionAnimation()

Creates an instance of ExpressionAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateExpressionAnimation.

CreateExpressionAnimation(String)

Creates an instance of ExpressionAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateExpressionAnimation.

CreateGeometricClip()

Creates an instance of CompositionGeometricClip.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateGeometricClip.

CreateGeometricClip(CompositionGeometry)

Creates an instance of CompositionGeometricClip using the specified geometry.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateGeometricClip.

CreateHostBackdropBrush()

Creates an instance of CompositionBackdropBrush that samples from the area behind the visual, before the window is drawn.

CreateImageVisual()

Creates an instance of ImageVisual.

CreateImplicitAnimationCollection()

Creates an instance of ImplicitAnimationCollection.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateImplicitAnimationCollection.

CreateInsetClip()

Creates an instance of InsetClip.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateInsetClip.

CreateInsetClip(Single, Single, Single, Single)

Creates an instance of InsetClip.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateInsetClip.

CreateLayerVisual()

Creates an instance of LayerVisual.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateLayerVisual.

CreateLinearEasingFunction()

Creates an instance of LinearEasingFunction.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateLinearEasingFunction.

CreateLinearGradientBrush()

Creates an instance of CompositionLinearGradientBrush.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateLinearGradientBrush.

CreateLineGeometry()

Creates an instance of CompositionLineGeometry.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateLineGeometry.

CreateMaskBrush()

Creates an instance of CompositionMaskBrush.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateMaskBrush.

CreateNineGridBrush()

Creates an instance of CompositionNineGridBrush.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateNineGridBrush.

CreatePathGeometry()

Creates an instance of CompositionPathGeometry.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreatePathGeometry.

CreatePathGeometry(CompositionPath)

Creates an instance of CompositionPathGeometry using the specified path.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreatePathGeometry.

CreatePathKeyFrameAnimation()

Creates an instance of PathKeyFrameAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreatePathKeyFrameAnimation.

CreatePointLight()

Creates an instance of PointLight.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreatePointLight.

CreateProjectedShadow()

Creates an instance of CompositionProjectedShadow.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateProjectedShadow.

CreateProjectedShadowCaster()

Creates an instance of CompositionProjectedShadowCaster.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateProjectedShadowCaster.

CreateProjectedShadowReceiver()

Creates an instance of CompositionProjectedShadowReceiver.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateProjectedShadowReceiver.

CreatePropertySet()

Creates an instance of CompositionPropertySet.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreatePropertySet.

CreateQuaternionKeyFrameAnimation()

Creates an instance of QuaternionKeyFrameAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateQuaternionKeyFrameAnimation.

CreateRadialGradientBrush()

Creates an instance of CompositionRadialGradientBrush.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateRadialGradientBrush.

CreateRectangleGeometry()

Creates an instance of CompositionRectangleGeometry.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateRectangleGeometry.

CreateRedirectVisual()

Creates an instance of RedirectVisual.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateRedirectVisual.

CreateRedirectVisual(Visual)

Creates an instance of RedirectVisual using the specified source.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateRedirectVisual.

CreateRoundedRectangleGeometry()

Creates an instance of CompositionRoundedRectangleGeometry.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateRoundedRectangleGeometry.

CreateScalarKeyFrameAnimation()

Creates an instance of ScalarKeyFrameAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateScalarKeyFrameAnimation.

CreateScopedBatch(CompositionBatchTypes)

Creates an instance of CompositionScopedBatch.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateScopedBatch.

CreateShapeVisual()

Creates an instance of ShapeVisual.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateShapeVisual.

CreateSolidColorVisual()

Creates an instance of SolidColorVisual.

CreateSpotLight()

Creates an instance of SpotLight.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSpotLight.

CreateSpringScalarAnimation()

Creates an instance of SpringScalarNaturalMotionAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSpringScalarAnimation.

CreateSpringVector2Animation()

Creates an instance of SpringVector2NaturalMotionAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSpringVector2Animation.

CreateSpringVector3Animation()

Creates an instance of SpringVector3NaturalMotionAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSpringVector3Animation.

CreateSpriteShape()

Creates an instance of CompositionSpriteShape.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSpriteShape.

CreateSpriteShape(CompositionGeometry)

Creates an instance of CompositionSpriteShape using the specified geometry.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSpriteShape.

CreateSpriteVisual()

Creates an instance of SpriteVisual.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSpriteVisual.

CreateStepEasingFunction()

Creates an instance of StepEasingFunction.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateStepEasingFunction.

CreateStepEasingFunction(Int32)

Creates an instance of StepEasingFunction with the specified step count.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateStepEasingFunction.

CreateSurfaceBrush()

Creates an instance of CompositionSurfaceBrush.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSurfaceBrush.

CreateSurfaceBrush(ICompositionSurface)

Creates an instance of CompositionSurfaceBrush using the specified composition surface.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateSurfaceBrush.

CreateTargetForCurrentView()

Creates a CompositionTarget for the current view.

CreateVector2KeyFrameAnimation()

Creates an instance of Vector2KeyFrameAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateVector2KeyFrameAnimation.

CreateVector3KeyFrameAnimation()

Creates an instance of Vector3KeyFrameAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateVector3KeyFrameAnimation.

CreateVector4KeyFrameAnimation()

Creates an instance of Vector4KeyFrameAnimation.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateVector4KeyFrameAnimation.

CreateViewBox()

Creates an instance of CompositionViewBox.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateViewBox.

CreateVisualSurface()

Creates an instance of CompositionVisualSurface.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.CreateVisualSurface.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetCommitBatch(CompositionBatchTypes)

Retrieves a commit batch for the current commit cycle.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.GetCommitBatch.

RequestCommitAsync()

Attempts to initiate a commit cycle ansynchronously.

Equivalent WinUI method: Microsoft.UI.Composition.Compositor.RequestCommitAsync.

Applies to

See also