Windows.UI.Composition Namespace

Provides APIs for user interface composition.

Equivalent WinUI namespace: Microsoft.UI.Composition.



A light that illuminates every targeted Visual equally .

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


Provides playback controls for a KeyFrameAnimation.

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


Provides event data for the CompositionPropertyAnimator.AnimationEnded event.


Represents information about a property that can be animated.

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


A time-based animation that targets a Boolean property with one or more key frames.

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


A bounce physics-based animation that targets any Scalar-based property.

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


A bounce physics-based animation that targets any Vector2-based property.

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


A bounce physics-based animation that targets any Vector3-based property.

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


A time-based animation that targets the Color property with one or more color key frames.

The ColorKeyFrameAnimation class is one of the supported types of KeyFrameAnimation s that is used to animate the Color property off of the Brush property on a SpriteVisual. When working with ColorKeyFrameAnimation s, utilize Windows.UI.Color objects for the values of keyframes. Utilize the InterpolationColorSpace property to define which color space the system will interpolate through for the animation.

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


Represents the base animation class.

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


Defines a group of animations.

CompositionAnimationGroup provides a way to group CompositionAnimation s in a list which will be started at the same time when StartAnimationGroup is called on CompositionObject. All CompositionAnimation in CompositionAnimationGroup need to assign a value to the Target property in the animation itself. CompositionAnimationGroup can also be associated with ImplicitAnimationCollection as an animation that gets executed as a result of a trigger.

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


A brush that applies an effect (or a chain of effects) to the region behind a SpriteVisual.

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


Arguments for the CompositionCommitBatch.Completed or CompositionScopedBatch.Completed events.

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


Base class for brushes used to paint a SpriteVisual.

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


Provides the ability to check system hardware capabilities so that Visual Layer Effects may be scaled accordingly. This allows you to ensure that your application's use of rendering-intensive operations is tailored to match the device's capabilities, providing optimum performance and pleasant visual results.

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


Base class for clipping objects such as InsetClip.

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


Paints a SpriteVisual with a solid color.

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


Describes the location and color of a transition point in a gradient.

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


Represents a collection of CompositionColorGradientStop objects that can be individually accessed by index.

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


A group of active animations or effects.

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


Represents a container for CompositionShapes, used to group items that share 2D transforms.

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


A drawing surface for interoperation with Direct2D or Direct3D.

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


Base class for interpolator functions to use with KeyFrameAnimations.

The CompositionEasingFunction class is the base class for easing functions that are used with KeyFrameAnimation s. Easing functions are used to describe how the system interpolates between two different keyframes. Currently, there are three supported easing functions: Linear, Cubic Bezier and Step.

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


Represents an effect.


Paints a SpriteVisual with the output of a filter effect. The filter effect description is defined using the CompositionEffectFactory class.

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


Creates a composition object that contains a Win2D effect description format in the Microsoft.Graphics.Canvas.Effects namespace.


Effects that are not supported are marked as [NoComposition] in the Win2D API Reference for effects namespace.

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


Represents information about the results of a call to the status of a call to CompositionEffectFactory.CompleteLoadAsync.


Used to declare an arbitrary name (a String) to be associated with a CompositionBrush (the “effect source”). The association of the given name and the effect source occurs when the SetSourceParameter method of a CompositionEffectBrush is called.

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


Represents an ellipse with the specified center and radius.

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


Clips a portion of a visual. The visible portion of the visual is a shape defined by a CompositionGeometry. The portion of the visual outside the geometry is clipped.

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


Represents the base class for composition geometries.

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


Represents a brush that describes a gradient, composed of gradient stops.

CompositionGradientBrush is supported only with Rgb and RgbLinear CompositionColorSpace.

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


Used to create all hardware bound resources for a given DirectX device on a compositor session. CompositionGraphicsDevice contains a DirectX device that is used to perform the GPU operations. Developers can obtain a Graphics device from the compositor top level object.

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


Represents an image.


Represents the result of loading a CompositionImage.


Represents options for a CompositionImage.


Base class for a light source that can target a UI scene.

The CompositionLight.Targets property determines which Visuals are lit.

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


Represents a brush that paints an area with a linear gradient.

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


Represents a straight line between two points.

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


Paints a SpriteVisual with a CompositionBrush with an opacity mask applied to it. The source of the opacity mask can be any CompositionBrush of type CompositionColorBrush, CompositionLinearGradientBrush, CompositionSurfaceBrush, CompositionEffectBrush or a CompositionNineGridBrush. The opacity mask must be specified as a CompositionSurfaceBrush.

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


Represents a drawing surface for mipmap textures.

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


Paints a SpriteVisual with a CompositionBrush after applying Nine-Grid Stretching to the contents of the Source brush. The source of the nine-grid stretch can by any CompositionBrush of type CompositionColorBrush, CompositionSurfaceBrush or a CompositionEffectBrush.

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


Base class of the composition API representing a node in the visual tree structure.

Composition objects are the visual tree structure on which all other features of the composition API use and build on. The API allows developers to define and create one or many Visual objects each representing a single node in a Visual tree.

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


Represents a series of connected lines and curves.

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


Represents a series of connected lines and curves.

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


Represents a scene-based shadow calculated using the relationship between the light, the visual that casts the shadow,and the visual that receives the shadow, such that the shadow is drawn differently on each receiver.

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


Represents an object that casts a projected shadow.

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


Represents a collection of CompositionProjectedShadowCaster objects.

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


Represents an object that can have a projected shadow cast on it.

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


Represents an unordered collection of CompositionProjectedShadowReceiver objects.

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


Animates composition properties.


Stores values as key-value pairs.

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


Represents a brush that paints an area with a radial gradient.

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



This API contains a known issue in Windows 10, versions 2004 and below. Don't use this API in your code.

Represents a rectangle shape of the specified size. To obtain a CompositionRectangleGeometry instance, call Compositor.CreateRectangleGeometry.

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


Represents a rectangle shape of the specified size with rounded corners.

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


An explicitly created group of active animations or effects.

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


Base class for shadows that can be applied to a SpriteVisual.

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


Represents the base shape class.

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


Represents a collection of CompositionShape objects that can be individually accessed by index.

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


A CompositionShape that draws Stroked and Filled CompositionGeometry.

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


Represents a collection of values that indicates the pattern of dashes and gaps that is used to outline shapes.

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


Paints a SpriteVisual with pixels from an ICompositionSurface.

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


Represents the window on which to display the composition tree.


Provides generalized transformation support for composition objects.

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


Represents a container that maps shape visual tree coordinates onto the visual.

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


Represents sparsely allocated bitmaps that can be associated with visuals for composition in a visual tree.

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


Represents a visual tree as an ICompositionSurface that can be used to paint a Visual using a CompositionBrush.

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


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.


A node in the visual tree that can have children.

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


Represents a cubic-bezier function for interpolating between animation key frames.

The cubic-bezier function is one of the more common easing functions used with KeyFrameAnimation s and are used frequently to describe smooth curves that can be scaled. Cubic-bezier functions are defined by two “control points” of type Vector2 that define the shape of the curve. When used, the animating property will change in between two keyframes based on the defined curve.

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


An infinitely large distant light source that emits light in a single direction. For example, a distant light could be used to represent sunlight.

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


A drop shadow cast by a SpriteVisual or LayerVisual.

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


Represents a visual tree node that is the root of a CompositionEffect.


A Composition Animation that uses a mathematical equation to calculate the value for an animating property every frame.

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


Represents a visual tree node that is the root of a CompositionImage.


A collection of animations triggered when a condition is met.

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


A collection of values that specify where an animation will start.

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


Clips a portion of a visual. The visible portion of the visual is a rectangle defined as inset values from the edges of the visual. The portion of the visual outside the rectangle is clipped.

InsetClips are defined using offsets from the bottom, left, right and top of the Visual to be clipped in pixels. It is possible to fully clip the entire Visual. Negative values are allowed. InsetClips support all the same transforms as Visuals except the 4x4 matrix. Unlike Visuals, InsetClips are 2D and are defined, instead, with a 3x2 matrix. InsetClip properties are fully animatable.

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


A time-based animation with one or more key frames. These frames are markers, allowing developers to specify values at specific times for the animating property. KeyFrame animations can be further customized by specifying how the animation interpolates between keyframes.

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


A ContainerVisual whose children are flattened into a single layer.

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


Represents a linear function for interpolating between animation key frames.

The linear function of another supported easing function that can be used with KeyFrame Animations. When used, the animating property will change in between two KeyFrames linearly over time.

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


Represents a physics-based animation that uses forces to dynamically move content.

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



This API contains a known issue in Windows 10, versions 20H2 and below. Do not use this API in your code.

Represents a time-based animation with one or more key frames where each key frame value is represented by a CompositionPath. The easing specifies the interopolation between paths.

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


A point source of light that emanates light in all directions.

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


A time-based animation that targets the Orientation property with one or more key frames.

The QuaternionKeyFrameAnimation class is one of the supported types of KeyFrameAnimation s that is used to animate the Orientation property on a Visual. Quaternions are a useful and sometimes simpler way to think about rotations – Quaternions take the shortest path between angles and avoid issues like Gimbal Lock that rotation angle/axis and rotation matrices run into. A Quaternion is made up of two components: a scalar and vector part.

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


Represents a visual that gets its content from another visual.

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


Arguments for the RenderingDeviceReplaced event.

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


A time-based animation that targets any Scalar-based property with one or more key frames.

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


The base Scalar NaturalMotionAnimation used to target a Scalar property.

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


Represents a visual tree node that is the root of a CompositionShape.

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


Represents a solid color.


A light source that casts inner and outer cones of light. For example, a flashlight.

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


A spring physics-based animation that targets any Scalar-based property.

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


A spring physics-based animation that targets any Vector2-based property.

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


A spring physics-based animation that targets any Vector3-based property.

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


Hosts 2D boxed content of type CompositionBrush. Any part of the visual not covered by pixels from the brush are rendered as transparent pixels. CompositionBrush can be either a CompositionBackdropBrush, CompositionColorBrush, a CompositionSurfaceBrush or a CompositionEffectBrush.

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


A step function for interpolating between animation key frames.

Advances animations in increments like steps which can be can be defined. Behaviors for initial and final steps can be customized.

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


A time-based animation that targets any Vector2-based property with one or more key frames.

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


The base Vector2 NaturalMotionAnimation used to target a Vector2 property.

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


A time-based animation that targets any Vector3-based property with one or more keyframes.

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


The base Vector3 NaturalMotionAnimation used to target a Vector3 property.

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


A time-based animation that targets any Vector4-based property with one or more keyframes.

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



Some information relates to pre-released product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

The base visual object in the visual hierarchy.

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


Represents a collection of visual instances.

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


An unordered collection of visuals.

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



Represents an object that has properties that can be referenced by an animation.

Equivalent WinUI interface: Microsoft.UI.Composition.IAnimationObject.


Base class for composition animations.

Equivalent WinUI interface: Microsoft.UI.Composition.ICompositionAnimationBase.


Represents the content of a surface that can be used to paint the bounds of a SpriteVisual. All surface types that can be used to paint a SpriteVisual must implement this interface. The following classes implement this interface and can be set as content of a SpriteVisual (using a CompositionSurfaceBrush):

Class Details
CompositionDrawingSurface Fixed sized surface that can be rendered with an image using LoadedImageSurface or custom drawing using Win2D (orD2D) or a video using MediaPlayer.
CompositionVirtualDrawingSurface Similar to CompositionDrawingSurface, except the surface is sparsely allocated.Typically used when you need to define a large amount of content but only expects a small portion of content to be visible at a given time. The content can be rendered using Win2D (or D2D).

Equivalent WinUI interface: Microsoft.UI.Composition.ICompositionSurface.


Marks an object to indicate to the system that it can resolve to a CompositionVisual

Equivalent WinUI interface: Microsoft.UI.Composition.IVisualElement.



Defines constants that specify how the AnimationController.Progress value is determined.

Equivalent WinUI enum: Microsoft.UI.Composition.AnimationControllerProgressBehavior.


Specifies the animation delay behavior.

Equivalent WinUI enum: Microsoft.UI.Composition.AnimationDelayBehavior.


Specifies the play direction of an animation.

Equivalent WinUI enum: AnimationDirection.


Defines constants that specify why an animation ended.


Specifies if the animation should loop.

Equivalent WinUI enum: AnimationIterationBehavior.


Defines constants that specify how an animated property can be accessed.

Equivalent WinUI enum: Microsoft.UI.Composition.AnimationPropertyAccessMode.


Specifies the behavior of an animation when it stops.

Equivalent WinUI enum: AnimationStopBehavior.


Specifies whether the back face of a visual is visible during a 3D transform.

Equivalent WinUI enum: CompositionBackfaceVisibility.


Batch types for CompositionCommitBatch and CompositionScopedBatch.

Equivalent WinUI enum: CompositionBatchTypes.


Specifies the algorithm used for interpolating pixels from ICompositionSurface when they do not form a one-to-one mapping to pixels on screen.

Equivalent WinUI enum: CompositionBitmapInterpolationMode.


Controls the aliasing behavior on the edges of visual borders.

Equivalent WinUI enum: CompositionBorderMode.


Specifies the color space for interpolating color values in ColorKeyFrameAnimation.

Equivalent WinUI enum: CompositionColorSpace.


Determines how a non-opaque visual's content is blended with the background content behind the visual.

Equivalent WinUI enum: CompositionCompositeMode.


Specifies the masking policy for a shadow.

Equivalent WinUI enum: Microsoft.UI.Composition.CompositionDropShadowSourcePolicy.


The status of the asynchronous compilation of a shader for an effect description.

Equivalent WinUI enum: CompositionEffectFactoryLoadStatus.


Indicates the outcome of an attempt to retrieve the value of a key-value pair.

Equivalent WinUI enum: CompositionGetValueStatus.


Defines constants that specify how to draw the gradient outside the brush's gradient vector or space.

Equivalent WinUI enum: Microsoft.UI.Composition.CompositionGradientExtendMode.


Defines constants that specify the status of a call to CompositionImage.CompleteLoadAsync.


Defines constants that specify the progress of loading a CompositionImage.


Defines constants that specify whether the gradient brush's positioning coordinates (StartPoint, EndPoint) are absolute or relative to the output area.

Equivalent WinUI enum: Microsoft.UI.Composition.CompositionMappingMode.


Specifies how content is scaled when mapped from its source to a destination space.

Equivalent WinUI enum: CompositionStretch.


Defines constants that specify the shape at the end of a line or segment.

Equivalent WinUI enum: Microsoft.UI.Composition.CompositionStrokeCap.


Defines constants that specify the shape used to join two lines or segments.

Equivalent WinUI enum: Microsoft.UI.Composition.CompositionStrokeLineJoin.


Windows.UI.Composition Overviews, Samples, and Known Issues

Item Description
Windows.UI.Composition Overview Overview and architecture of the API
Windows.UI.Composition Samples API samples in the official Github
Known Issues and Latest Information Latest updates on the API in the MSDN Forums

See also