Windows.UI.Composition Namespace

Provides APIs for user interface composition.

Classes

AmbientLight

A light that illuminates every targeted Visual equally .

AnimationController

Provides playback controls for a KeyFrameAnimation.

AnimationEndedEventArgs

Provides event data for the CompositionPropertyAnimator.AnimationEnded event.

AnimationPropertyInfo

Represents information about a property that can be animated.

BooleanKeyFrameAnimation

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

BounceScalarNaturalMotionAnimation

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

BounceVector2NaturalMotionAnimation

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

BounceVector3NaturalMotionAnimation

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

ColorKeyFrameAnimation

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.

CompositionAnimation

Represents the base animation class.

CompositionAnimationGroup

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.

CompositionBackdropBrush

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

CompositionBatchCompletedEventArgs

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

CompositionBrush

Base class for brushes used to paint a SpriteVisual.

CompositionCapabilities

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.

CompositionClip

Base class for clipping objects such as InsetClip.

CompositionColorBrush

Paints a SpriteVisual with a solid color.

CompositionColorGradientStop

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

CompositionColorGradientStopCollection

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

CompositionCommitBatch

A group of active animations or effects.

CompositionContainerShape

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

CompositionDrawingSurface

A drawing surface for interoperation with Direct2D or Direct3D.

CompositionEasingFunction

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.

CompositionEffect

Represents an effect.

CompositionEffectBrush

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

CompositionEffectFactory

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

Note

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

CompositionEffectFactoryLoadResult

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

CompositionEffectSourceParameter

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.

CompositionEllipseGeometry

Represents an ellipse with the specified center and radius.

CompositionGeometricClip

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.

CompositionGeometry

Represents the base class for composition geometries.

CompositionGradientBrush

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

CompositionGradientBrush is supported only with Rgb and RgbLinear CompositionColorSpace.

CompositionGraphicsDevice

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.

CompositionImage

Represents an image.

CompositionImageLoadResult

Represents the result of loading a CompositionImage.

CompositionImageOptions

Represents options for a CompositionImage.

CompositionLight

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

The CompositionLight.Targets property determines which Visuals are lit.

CompositionLinearGradientBrush

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

CompositionLineGeometry

Represents a straight line between two points.

CompositionMaskBrush

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.

CompositionMipmapSurface

Represents a drawing surface for mipmap textures.

CompositionNineGridBrush

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.

CompositionObject

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.

CompositionPath

Represents a series of connected lines and curves.

CompositionPathGeometry

Represents a series of connected lines and curves.

CompositionProjectedShadow

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.

CompositionProjectedShadowCaster

Represents an object that casts a projected shadow.

CompositionProjectedShadowCasterCollection

Represents a collection of CompositionProjectedShadowCaster objects.

CompositionProjectedShadowReceiver

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

CompositionProjectedShadowReceiverUnorderedCollection

Represents an unordered collection of CompositionProjectedShadowReceiver objects.

CompositionPropertyAnimator

Animates composition properties.

CompositionPropertySet

Stores values as key-value pairs.

CompositionRadialGradientBrush

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

CompositionRectangleGeometry

Warning

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

Represents a rectangle shape of the specified size.

CompositionRoundedRectangleGeometry

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

CompositionScopedBatch

An explicitly created group of active animations or effects.

CompositionShadow

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

CompositionShape

Represents the base shape class.

CompositionShapeCollection

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

CompositionSpriteShape

A CompositionShape that draws Stroked and Filled CompositionGeometry.

CompositionStrokeDashArray

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

CompositionSurfaceBrush

Paints a SpriteVisual with pixels from an ICompositionSurface.

CompositionTarget

Represents the window on which to display the composition tree.

CompositionTransform

Provides generalized transformation support for composition objects.

CompositionViewBox

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

CompositionVirtualDrawingSurface

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

CompositionVisualSurface

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

Compositor

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.

ContainerVisual

A node in the visual tree that can have children.

CubicBezierEasingFunction

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.

DistantLight

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

DropShadow

A drop shadow cast by a SpriteVisual or LayerVisual.

EffectVisual

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

ExpressionAnimation

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

ImageVisual

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

ImplicitAnimationCollection

A collection of animations triggered when a condition is met.

InitialValueExpressionCollection

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

InsetClip

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.

KeyFrameAnimation

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.

LayerVisual

A ContainerVisual whose children are flattened into a single layer.

LinearEasingFunction

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.

NaturalMotionAnimation

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

PathKeyFrameAnimation

Warning

This API contains a known issue in Windows 10, versions 2004 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.

PointLight

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

QuaternionKeyFrameAnimation

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.

RedirectVisual

Represents a visual that gets its content from another visual.

RenderingDeviceReplacedEventArgs

Arguments for the RenderingDeviceReplaced event.

ScalarKeyFrameAnimation

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

ScalarNaturalMotionAnimation

The base Scalar NaturalMotionAnimation used to target a Scalar property.

ShapeVisual

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

SolidColorVisual

Represents a solid color.

SpotLight

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

SpringScalarNaturalMotionAnimation

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

SpringVector2NaturalMotionAnimation

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

SpringVector3NaturalMotionAnimation

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

SpriteVisual

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.

StepEasingFunction

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.

Vector2KeyFrameAnimation

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

Vector2NaturalMotionAnimation

The base Vector2 NaturalMotionAnimation used to target a Vector2 property.

Vector3KeyFrameAnimation

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

Vector3NaturalMotionAnimation

The base Vector3 NaturalMotionAnimation used to target a Vector3 property.

Vector4KeyFrameAnimation

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

Visual

Note

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.

VisualCollection

Represents a collection of visual instances.

VisualUnorderedCollection

An unordered collection of visuals.

Interfaces

IAnimationObject

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

ICompositionAnimationBase

Base class for composition animations.

ICompositionSurface

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).
IVisualElement

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

Enums

AnimationControllerProgressBehavior

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

AnimationDelayBehavior

Specifies the animation delay behavior.

AnimationDirection

Specifies the play direction of an animation.

AnimationEndReason

Defines constants that specify why an animation ended.

AnimationIterationBehavior

Specifies if the animation should loop.

AnimationPropertyAccessMode

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

AnimationStopBehavior

Specifies the behavior of an animation when it stops.

CompositionBackfaceVisibility

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

CompositionBatchTypes

Batch types for CompositionCommitBatch and CompositionScopedBatch.

CompositionBitmapInterpolationMode

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

CompositionBorderMode

Controls the aliasing behavior on the edges of visual borders.

CompositionColorSpace

Specifies the color space for interpolating color values in ColorKeyFrameAnimation.

CompositionCompositeMode

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

CompositionDropShadowSourcePolicy

Specifies the masking policy for a shadow.

CompositionEffectFactoryLoadStatus

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

CompositionGetValueStatus

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

CompositionGradientExtendMode

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

CompositionImageLoadStatus

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

CompositionImageProgressStage

Defines constants that specify the progress of loading a CompositionImage.

CompositionMappingMode

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

CompositionStretch

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

CompositionStrokeCap

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

CompositionStrokeLineJoin

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

Remarks

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