Compositor Compositor Compositor Class

Definition

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.

Prerelease APIs are identified by a Prerelease label.

Prerelease. 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.

public : sealed class Compositor : IClosable, ICompositor, ICompositor2, ICompositor3, ICompositor4public sealed class Compositor : IDisposable, ICompositor, ICompositor2, ICompositor3, ICompositor4Public NotInheritable Class Compositor Implements IDisposable, ICompositor, ICompositor2, ICompositor3, ICompositor4
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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.

Constructors

Compositor() Compositor() Compositor()

Creates an instance of Compositor.

public : Compositor()public Compositor()Public Sub New()
Attributes

Methods

Close() Close() Close()

Closes the Compositor object and releases system resources.

public : void Close()This member is not implemented in C#This member is not implemented in VB.Net
Attributes

CreateAmbientLight() CreateAmbientLight() CreateAmbientLight()

Creates an instance of AmbientLight.

public : AmbientLight CreateAmbientLight()public AmbientLight CreateAmbientLight()Public Function CreateAmbientLight() As AmbientLight
Returns

Returns the created AmbientLight object.

Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

CreateAnimationGroup() CreateAnimationGroup() CreateAnimationGroup()

Creates an instance of CompositionAnimationGroup.

public : CompositionAnimationGroup CreateAnimationGroup()public CompositionAnimationGroup CreateAnimationGroup()Public Function CreateAnimationGroup() As CompositionAnimationGroup
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

CreateBackdropBrush() CreateBackdropBrush() CreateBackdropBrush()

Creates an instance of CompositionBackdropBrush.

public : CompositionBackdropBrush CreateBackdropBrush()public CompositionBackdropBrush CreateBackdropBrush()Public Function CreateBackdropBrush() As CompositionBackdropBrush
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Examples


// Create an effect description 

GaussianBlurEffect blurEffect = new GaussianBlurEffect() 
{ 
  Name = "Blur", 
  BlurAmount = 1.0f, 
  BorderMode = EffectBorderMode.Hard, 
  Optimization = EffectOptimization.Balanced 
}; 

blurEffect.Source = new CompositionEffectSourceParameter("source"); 

CompositionEffectFactory blurEffectFactory = _compositor.CreateEffectFactory(blurEffect); 

CompositionEffectBrush blurBrush = blurEffectFactory.CreateBrush(); 

// Create a BackdropBrush and bind it to the EffectSourceParameter “source” 
CompositionBackdropBrush backdropBrush = _compositor.CreateBackdropBrush(); 

blurBrush.SetSourceParameter("source", backdropBrush); 

Remarks

See the remarks section of CompositionEffectBrush for information on creating and using effects.

CreateColorBrush() CreateColorBrush() CreateColorBrush()

Creates an instance of CompositionColorBrush.

public : CompositionColorBrush CreateColorBrush()public CompositionColorBrush CreateColorBrush()Public Function CreateColorBrush() As CompositionColorBrush
Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)
See Also

CreateColorBrush(Color) CreateColorBrush(Color) CreateColorBrush(Color)

Creates an instance of CompositionColorBrush using the specified color.

public : CompositionColorBrush CreateColorBrush(Color color)public CompositionColorBrush CreateColorBrush(Color color)Public Function CreateColorBrush(color As Color) As CompositionColorBrush
Parameters
color
Color Color Color

The color for the brush to use.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)
See Also

CreateColorGradientStop() CreateColorGradientStop() CreateColorGradientStop()

Prerelease. Creates an instance of CompositionColorGradientStop.

public : CompositionColorGradientStop CreateColorGradientStop()public CompositionColorGradientStop CreateColorGradientStop()Public Function CreateColorGradientStop() As CompositionColorGradientStop
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

CreateColorGradientStop(Single, Color) CreateColorGradientStop(Single, Color) CreateColorGradientStop(Single, Color)

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

public : CompositionColorGradientStop CreateColorGradientStop(float offset, Color color)public CompositionColorGradientStop CreateColorGradientStop(Single offset, Color color)Public Function CreateColorGradientStop(offset As Single, color As Color) As CompositionColorGradientStop
Parameters
offset
float Single Single

The location of the gradient stop within the gradient vector.

color
Color Color Color

The color of the gradient stop.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

CreateColorKeyFrameAnimation() CreateColorKeyFrameAnimation() CreateColorKeyFrameAnimation()

Creates an instance of ColorKeyFrameAnimation.

public : ColorKeyFrameAnimation CreateColorKeyFrameAnimation()public ColorKeyFrameAnimation CreateColorKeyFrameAnimation()Public Function CreateColorKeyFrameAnimation() As ColorKeyFrameAnimation
Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

CreateContainerVisual() CreateContainerVisual() CreateContainerVisual()

Creates an instance of ContainerVisual.

public : ContainerVisual CreateContainerVisual()public ContainerVisual CreateContainerVisual()Public Function CreateContainerVisual() As ContainerVisual
Returns
Attributes

Examples


//
// Set up Windows.UI.Composition Compositor, root ContainerVisual, and associate with
// the CoreWindow.
//

_compositor = new Compositor();

_root = _compositor.CreateContainerVisual();
_view.CompositionRootVisual = _root;


//
// Create a simple scene.
//

var child = _compositor.CreateSpriteVisual();
child.Brush = _compositor.CreateColorBrush(Color.FromArgb(0xFF, 0x00, 0xCC, 0x00));
child.Offset = new Vector2(50.0f, 50.0f);
child.Size = new Vector2(200, 200);

_root.Children.InsertAtTop(child);

ref class MyClass
{
    Compositor ^ _compositor;
    CompositionTarget ^ _target;
    ContainerVisual ^ _root;

    void Initialize()
    {
        //
        // Set up Composition.
        //

        _compositor = ref new Compositor();
        _target = _compositor->CreateTargetForCurrentView();
        _root = _compositor->CreateContainerVisual();
        _target->Root = _root;


        //
        // Create a simple scene.
        //

        auto child = _compositor->CreateSpriteVisual();
        child->Brush = _compositor.CreateColorBrush(ColorHelper::FromArgb(0xFF, 0x00, 0xCC, 0x00));
        child->Offset = float2(50.0f, 50.0f);
        child->Size = float2(200, 200);

        _root->Children->InsertAtTop(child);
    }
}

CreateCubicBezierEasingFunction(Vector2, Vector2) CreateCubicBezierEasingFunction(Vector2, Vector2) CreateCubicBezierEasingFunction(Vector2, Vector2)

Creates an instance of CubicBezierEasingFunction.

public : CubicBezierEasingFunction CreateCubicBezierEasingFunction(Vector2 controlPoint1, Vector2 controlPoint2)public CubicBezierEasingFunction CreateCubicBezierEasingFunction(Vector2 controlPoint1, Vector2 controlPoint2)Public Function CreateCubicBezierEasingFunction(controlPoint1 As Vector2, controlPoint2 As Vector2) As CubicBezierEasingFunction
Parameters
controlPoint1
Vector2 Vector2 Vector2

The first control point for the easing function.

controlPoint2
Vector2 Vector2 Vector2

The second control point for the easing function.

Returns
Attributes

CreateDistantLight() CreateDistantLight() CreateDistantLight()

Creates an instance of DistantLight.

public : DistantLight CreateDistantLight()public DistantLight CreateDistantLight()Public Function CreateDistantLight() As DistantLight
Returns

Returns the created DistantLight object.

Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

CreateDropShadow() CreateDropShadow() CreateDropShadow()

Creates an instance of DropShadow.

public : DropShadow CreateDropShadow()public DropShadow CreateDropShadow()Public Function CreateDropShadow() As DropShadow
Returns

Returns the created DropShadow object.

Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

CreateEffectFactory(IGraphicsEffect) CreateEffectFactory(IGraphicsEffect) CreateEffectFactory(IGraphicsEffect)

Creates an instance of CompositionEffectFactory.

public : CompositionEffectFactory CreateEffectFactory(IGraphicsEffect graphicsEffect)public CompositionEffectFactory CreateEffectFactory(IGraphicsEffect graphicsEffect)Public Function CreateEffectFactory(graphicsEffect As IGraphicsEffect) As CompositionEffectFactory
Parameters
graphicsEffect
IGraphicsEffect IGraphicsEffect IGraphicsEffect

The type of effect to create.

Returns
Attributes

Remarks

Creating an effect factory compiles an effect and allows instances of that effect to be created.

See the remarks section of CompositionEffectBrush for information on creating and using effects.

Currently supported effects types are:

Effect NameDescription
ArithmeticCompositeEffectCombines two images using a weighted sum of pixels from the source images.
CompositeEffectCombines two or more images based on their alpha channel. This effect has 13 different composite modes. The composite effect accepts 2 or more inputs. When you specify 2 images, destination is the first input (index 0) and the source is the second input (index 1). If you specify more than 2 inputs the images are composited starting with the first input and the second and so on.
BlendEffect (21 of 26 modes)Combines 2 images. This effect has 26 blend modes with 21 of the modes currently supported by the Compositon API. The 5 blend modes that are currently not implemented are dissolve, hue, saturation, color, and luminosity.
ColorSourceEffectThe color source effect generates a specified solid color. It is useful as a source to other effects, such as tinting an image using a blend with a color source.
SaturationEffectAlters the saturation of an image. If you set it to 1 the output image is fully saturated. If you set it to 0 the output image is monochrome.
Transform2DEffectThe 2D affine transform effect applies a spatial transform to an image based on a 3X2 matrix. This effect can be used to rotate, scale, skew, or translate an image. Or, you can combine these operations. Affine transfers preserve parallel lines and the ratio of distances between any three points in an image.

See the Win2D namespace, Microsoft.Graphics.Canvas.Effects, for more information on the effect types.

See Also

CreateEffectFactory(IGraphicsEffect, IIterable<String>) CreateEffectFactory(IGraphicsEffect, IIterable<String>) CreateEffectFactory(IGraphicsEffect, IIterable<String>)

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

public : CompositionEffectFactory CreateEffectFactory(IGraphicsEffect graphicsEffect, IIterable<PlatForm::String> animatableProperties)public CompositionEffectFactory CreateEffectFactory(IGraphicsEffect graphicsEffect, IEnumerable<String> animatableProperties)Public Function CreateEffectFactory(graphicsEffect As IGraphicsEffect, animatableProperties As IEnumerable<String>) As CompositionEffectFactory
Parameters
graphicsEffect
IGraphicsEffect IGraphicsEffect IGraphicsEffect

The type of effect to create.

animatableProperties
IIterable<PlatForm::String> IEnumerable<String> IEnumerable<String>

The list of properties that should be animatable. Properties are specified using strings of the form 'EffectName.PropertyName', where 'EffectName' identifies a graphics effect object by its IGraphicsEffect.Name property and 'PropertyName' identifies a property of that object.

Returns
Attributes
See Also

CreateExpressionAnimation() CreateExpressionAnimation() CreateExpressionAnimation()

Creates an instance of ExpressionAnimation.

public : ExpressionAnimation CreateExpressionAnimation()public ExpressionAnimation CreateExpressionAnimation()Public Function CreateExpressionAnimation() As ExpressionAnimation
Returns
Attributes
See Also

CreateExpressionAnimation(String) CreateExpressionAnimation(String) CreateExpressionAnimation(String)

Creates an instance of ExpressionAnimation.

public : ExpressionAnimation CreateExpressionAnimation(PlatForm::String expression)public ExpressionAnimation CreateExpressionAnimation(String expression)Public Function CreateExpressionAnimation(expression As String) As ExpressionAnimation
Parameters
expression
PlatForm::String String String

The expression describing how the ExpressionAnimation should calculate its current value.

Returns
Attributes
See Also

CreateHostBackdropBrush() CreateHostBackdropBrush() CreateHostBackdropBrush()

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

public : CompositionBackdropBrush CreateHostBackdropBrush()public CompositionBackdropBrush CreateHostBackdropBrush()Public Function CreateHostBackdropBrush() As CompositionBackdropBrush
Returns

Returns the created CompositionBackdropBrush.

Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

The standard backdrop brush samples the area immediately behind the visual where it is used.� The host backdrop brush tells the compositor to sample from the area behind the visual, before the window is drawn.� The host backdrop brush is translucent and it hit-tests as opaque. The app cannot read the pixel data back.

CreateImplicitAnimationCollection() CreateImplicitAnimationCollection() CreateImplicitAnimationCollection()

Creates an instance of ImplicitAnimationCollection.

public : ImplicitAnimationCollection CreateImplicitAnimationCollection()public ImplicitAnimationCollection CreateImplicitAnimationCollection()Public Function CreateImplicitAnimationCollection() As ImplicitAnimationCollection
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Examples


class PropertyAnimation 
{ 
  PropertyAnimation(Compositor compositor, SpriteVisual heroVisual, SpriteVisual listVisual) 
  { 
    // Define ImplicitAnimationCollection 
    ImplicitAnimationCollection implicitAnimations = compositor.CreateImplicitAnimationCollection(); 

    // Trigger animation when the “Offset” property changes. 
    implicitAnimations["Offset"] = CreateAnimation(compositor); 

    // Assign ImplicitAnimations to a visual. Unlike Visual.Children,     
    // ImplicitAnimations can be shared by multiple visuals so that they  
    // share the same implicit animation behavior (same as Visual.Clip). 
    heroVisual.ImplicitAnimations = implicitAnimations; 

    // ImplicitAnimations can be shared among visuals  
    listVisual.ImplicitAnimations = implicitAnimations; 

    listVisual.Offset = new Vector3(20f, 20f, 20f); 
  } 

  Vector3KeyFrameAnimation CreateAnimation(Compositor compositor) 
  { 
    Vector3KeyFrameAnimation animation = compositor.CreateVector3KeyFrameAnimation(); 
    animation.InsertExpressionKeyFrame(0f, "this.StartingValue"); 
    animation.InsertExpressionKeyFrame(1f, "this.FinalValue"); 
    animation.Target = “Offset”; 
    animation.Duration = TimeSpan.FromSeconds(0.25); 
    return animation; 
  } 

} 

CreateInsetClip() CreateInsetClip() CreateInsetClip()

Creates an instance of InsetClip.

public : InsetClip CreateInsetClip()public InsetClip CreateInsetClip()Public Function CreateInsetClip() As InsetClip
Returns

Returns the created InsetClip object.

Attributes
See Also

CreateInsetClip(Single, Single, Single, Single) CreateInsetClip(Single, Single, Single, Single) CreateInsetClip(Single, Single, Single, Single)

Creates an instance of InsetClip.

public : InsetClip CreateInsetClip(float leftInset, float topInset, float rightInset, float bottomInset)public InsetClip CreateInsetClip(Single leftInset, Single topInset, Single rightInset, Single bottomInset)Public Function CreateInsetClip(leftInset As Single, topInset As Single, rightInset As Single, bottomInset As Single) As InsetClip
Parameters
leftInset
float Single Single

Inset from the left of the visual.

topInset
float Single Single

Inset from the top of the visual.

rightInset
float Single Single

Inset from the right of the visual.

bottomInset
float Single Single

Inset from the bottom of the visual.

Returns

Returns the created InsetClip object.

Attributes
See Also

CreateLayerVisual() CreateLayerVisual() CreateLayerVisual()

Creates an instance of LayerVisual.

public : LayerVisual CreateLayerVisual()public LayerVisual CreateLayerVisual()Public Function CreateLayerVisual() As LayerVisual
Returns

Returns the created LayerVisual object.

Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

CreateLinearEasingFunction() CreateLinearEasingFunction() CreateLinearEasingFunction()

Creates an instance of LinearEasingFunction.

public : LinearEasingFunction CreateLinearEasingFunction()public LinearEasingFunction CreateLinearEasingFunction()Public Function CreateLinearEasingFunction() As LinearEasingFunction
Returns
Attributes

CreateLinearGradientBrush() CreateLinearGradientBrush() CreateLinearGradientBrush()

Prerelease. Creates an instance of CompositionLinearGradientBrush.

public : CompositionLinearGradientBrush CreateLinearGradientBrush()public CompositionLinearGradientBrush CreateLinearGradientBrush()Public Function CreateLinearGradientBrush() As CompositionLinearGradientBrush
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

CreateMaskBrush() CreateMaskBrush() CreateMaskBrush()

Creates an instance of CompositionMaskBrush.

public : CompositionMaskBrush CreateMaskBrush()public CompositionMaskBrush CreateMaskBrush()Public Function CreateMaskBrush() As CompositionMaskBrush
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

CreateNineGridBrush() CreateNineGridBrush() CreateNineGridBrush()

Creates an instance of CompositionNineGridBrush.

public : CompositionNineGridBrush CreateNineGridBrush()public CompositionNineGridBrush CreateNineGridBrush()Public Function CreateNineGridBrush() As CompositionNineGridBrush
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

CreatePointLight() CreatePointLight() CreatePointLight()

Creates an instance of PointLight.

public : PointLight CreatePointLight()public PointLight CreatePointLight()Public Function CreatePointLight() As PointLight
Returns

Returns the created PointLight object.

Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

CreatePropertySet() CreatePropertySet() CreatePropertySet()

Creates an instance of CompositionPropertySet.

public : CompositionPropertySet CreatePropertySet()public CompositionPropertySet CreatePropertySet()Public Function CreatePropertySet() As CompositionPropertySet
Returns
Attributes

CreateQuaternionKeyFrameAnimation() CreateQuaternionKeyFrameAnimation() CreateQuaternionKeyFrameAnimation()

Creates an instance of QuaternionKeyFrameAnimation.

public : QuaternionKeyFrameAnimation CreateQuaternionKeyFrameAnimation()public QuaternionKeyFrameAnimation CreateQuaternionKeyFrameAnimation()Public Function CreateQuaternionKeyFrameAnimation() As QuaternionKeyFrameAnimation
Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

CreateScalarKeyFrameAnimation() CreateScalarKeyFrameAnimation() CreateScalarKeyFrameAnimation()

Creates an instance of ScalarKeyFrameAnimation.

public : ScalarKeyFrameAnimation CreateScalarKeyFrameAnimation()public ScalarKeyFrameAnimation CreateScalarKeyFrameAnimation()Public Function CreateScalarKeyFrameAnimation() As ScalarKeyFrameAnimation
Returns
Attributes

CreateScopedBatch(CompositionBatchTypes) CreateScopedBatch(CompositionBatchTypes) CreateScopedBatch(CompositionBatchTypes)

Creates an instance of CompositionScopedBatch.

public : CompositionScopedBatch CreateScopedBatch(CompositionBatchTypes batchType)public CompositionScopedBatch CreateScopedBatch(CompositionBatchTypes batchType)Public Function CreateScopedBatch(batchType As CompositionBatchTypes) As CompositionScopedBatch
Parameters
batchType
CompositionBatchTypes CompositionBatchTypes CompositionBatchTypes

The type of composition batch to create.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

CreateSpotLight() CreateSpotLight() CreateSpotLight()

Creates an instance of SpotLight.

public : SpotLight CreateSpotLight()public SpotLight CreateSpotLight()Public Function CreateSpotLight() As SpotLight
Returns

Returns the created SpotLight object.

Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

CreateSpringScalarAnimation() CreateSpringScalarAnimation() CreateSpringScalarAnimation()

Prerelease. Creates an instance of SpringScalarNaturalMotionAnimation.

public : SpringScalarNaturalMotionAnimation CreateSpringScalarAnimation()public SpringScalarNaturalMotionAnimation CreateSpringScalarAnimation()Public Function CreateSpringScalarAnimation() As SpringScalarNaturalMotionAnimation
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

CreateSpringVector2Animation() CreateSpringVector2Animation() CreateSpringVector2Animation()

Prerelease. Creates an instance of SpringVector2NaturalMotionAnimation.

public : SpringVector2NaturalMotionAnimation CreateSpringVector2Animation()public SpringVector2NaturalMotionAnimation CreateSpringVector2Animation()Public Function CreateSpringVector2Animation() As SpringVector2NaturalMotionAnimation
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

CreateSpringVector3Animation() CreateSpringVector3Animation() CreateSpringVector3Animation()

Prerelease. Creates an instance of SpringVector3NaturalMotionAnimation.

public : SpringVector3NaturalMotionAnimation CreateSpringVector3Animation()public SpringVector3NaturalMotionAnimation CreateSpringVector3Animation()Public Function CreateSpringVector3Animation() As SpringVector3NaturalMotionAnimation
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

CreateSpriteVisual() CreateSpriteVisual() CreateSpriteVisual()

Creates an instance of SpriteVisual.

public : SpriteVisual CreateSpriteVisual()public SpriteVisual CreateSpriteVisual()Public Function CreateSpriteVisual() As SpriteVisual
Returns

Returns the created SpriteVisual object.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

CreateStepEasingFunction() CreateStepEasingFunction() CreateStepEasingFunction()

Creates an instance of StepEasingFunction.

public : StepEasingFunction CreateStepEasingFunction()public StepEasingFunction CreateStepEasingFunction()Public Function CreateStepEasingFunction() As StepEasingFunction
Returns
Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Examples


StepsEasing(Compositor compositor, SpriteVisual heroVisual) 
{ 
  // This step function makes the property offset change in 5 steps  
  // i.e. goes from (0,0,0) à (20,20,20) in 5 steps. 
  StepEasingFunction steps = compositor.CreateStepEasingFunction(); 
  steps.StepCount = 5; 
  Vector3KeyFrameAnimation animation = compositor.CreateVector3KeyFrameAnimation(); 
  animation.InsertKeyFrame(0f, new Vector3(0f,0f,0f)); 
  animation.InsertKeyFrame(1f, new Vector3(20f,20f,0f), steps); 
  animation.Duration = TimeSpan.FromSeconds(2); 

  // Run animation for 4 times 
  animation.IterationCount = 4; 

  heroVisual.StartAnimation("Offset", animation); 
} 
See Also

CreateStepEasingFunction(Int32) CreateStepEasingFunction(Int32) CreateStepEasingFunction(Int32)

Creates an instance of StepEasingFunction with the specified step count.

public : StepEasingFunction CreateStepEasingFunction(int stepCount)public StepEasingFunction CreateStepEasingFunction(Int32 stepCount)Public Function CreateStepEasingFunction(stepCount As Int32) As StepEasingFunction
Parameters
stepCount
int Int32 Int32

The step count for the StepEasingFunction.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
See Also

CreateSurfaceBrush() CreateSurfaceBrush() CreateSurfaceBrush()

Creates an instance of CompositionSurfaceBrush.

public : CompositionSurfaceBrush CreateSurfaceBrush()public CompositionSurfaceBrush CreateSurfaceBrush()Public Function CreateSurfaceBrush() As CompositionSurfaceBrush
Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Examples


SpriteVisual visual= compositor.CreateSpriteVisual();

var surface = graphicsDevice.CreateDrawingSurface(new Size(300, 50), 
                       Windows.Graphics.DirectX.DirectXPixelFormat.B8G8R8A8UIntNormalized, 
                       CompositionAlphaMode.Ignore); 

var surfaceBrush = _compositor.CreateSurfaceBrush(surface);
surfaceBrush.HorizontalAlignmentRatio = 0.0;
surfaceBrush.VerticalAlignmentRatio= 0.0;
surfaceBrush.Stretch = CompositionStretch.None;

visual.Brush = surfaceBrush;
See Also

CreateSurfaceBrush(ICompositionSurface) CreateSurfaceBrush(ICompositionSurface) CreateSurfaceBrush(ICompositionSurface)

Creates an instance of CompositionSurfaceBrush using the specified composition surface.

public : CompositionSurfaceBrush CreateSurfaceBrush(ICompositionSurface surface)public CompositionSurfaceBrush CreateSurfaceBrush(ICompositionSurface surface)Public Function CreateSurfaceBrush(surface As ICompositionSurface) As CompositionSurfaceBrush
Parameters
surface
ICompositionSurface ICompositionSurface ICompositionSurface

The composition surface to associate with the CompositionSurfaceBrush.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)
See Also

CreateTargetForCurrentView() CreateTargetForCurrentView() CreateTargetForCurrentView()

Creates a CompositionTarget for the current view.

public : CompositionTarget CreateTargetForCurrentView()public CompositionTarget CreateTargetForCurrentView()Public Function CreateTargetForCurrentView() As CompositionTarget
Returns
Attributes

CreateVector2KeyFrameAnimation() CreateVector2KeyFrameAnimation() CreateVector2KeyFrameAnimation()

Creates an instance of Vector2KeyFrameAnimation.

public : Vector2KeyFrameAnimation CreateVector2KeyFrameAnimation()public Vector2KeyFrameAnimation CreateVector2KeyFrameAnimation()Public Function CreateVector2KeyFrameAnimation() As Vector2KeyFrameAnimation
Returns
Attributes

CreateVector3KeyFrameAnimation() CreateVector3KeyFrameAnimation() CreateVector3KeyFrameAnimation()

Creates an instance of Vector3KeyFrameAnimation.

public : Vector3KeyFrameAnimation CreateVector3KeyFrameAnimation()public Vector3KeyFrameAnimation CreateVector3KeyFrameAnimation()Public Function CreateVector3KeyFrameAnimation() As Vector3KeyFrameAnimation
Returns
Attributes

CreateVector4KeyFrameAnimation() CreateVector4KeyFrameAnimation() CreateVector4KeyFrameAnimation()

Creates an instance of Vector4KeyFrameAnimation.

public : Vector4KeyFrameAnimation CreateVector4KeyFrameAnimation()public Vector4KeyFrameAnimation CreateVector4KeyFrameAnimation()Public Function CreateVector4KeyFrameAnimation() As Vector4KeyFrameAnimation
Returns
Attributes

Dispose() Dispose() Dispose()

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

This member is not implemented in C++void Dispose()Sub Dispose
Attributes

GetCommitBatch(CompositionBatchTypes) GetCommitBatch(CompositionBatchTypes) GetCommitBatch(CompositionBatchTypes)

Retrieves a commit batch for the current commit cycle.

public : CompositionCommitBatch GetCommitBatch(CompositionBatchTypes batchType)public CompositionCommitBatch GetCommitBatch(CompositionBatchTypes batchType)Public Function GetCommitBatch(batchType As CompositionBatchTypes) As CompositionCommitBatch
Parameters
Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

See Also