CompositionDrawingSurface Class

Definition

A drawing surface for interoperation with Direct2D or Direct3D.

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

public ref class CompositionDrawingSurface sealed : CompositionObject, ICompositionSurface
public ref class CompositionDrawingSurface : CompositionObject, ICompositionSurface
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class CompositionDrawingSurface final : CompositionObject, ICompositionSurface
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class CompositionDrawingSurface : CompositionObject, ICompositionSurface
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class CompositionDrawingSurface : CompositionObject, ICompositionSurface
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class CompositionDrawingSurface : CompositionObject, ICompositionSurface
Public NotInheritable Class CompositionDrawingSurface
Inherits CompositionObject
Implements ICompositionSurface
Public Class CompositionDrawingSurface
Inherits CompositionObject
Implements ICompositionSurface
Inheritance
Object IInspectable CompositionObject CompositionDrawingSurface
Derived
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v2.0)

Examples

See the code example in Composition native interoperation with DirectX and Direct2D.

Remarks

CompositionDrawingSurface is a fixed sized surface that can be rendered with:

Version history

Windows version SDK version Value added
1703 15063 Resize
1703 15063 Scroll(PointInt32)
1703 15063 Scroll(PointInt32,RectInt32)
1703 15063 ScrollWithClip(PointInt32,RectInt32)
1703 15063 ScrollWithClip(PointInt32,RectInt32,RectInt32)
1703 15063 SizeInt32

Properties

AlphaMode

The alpha mode of the drawing surface.

Equivalent WinUI property: Microsoft.UI.Composition.CompositionDrawingSurface.AlphaMode.

Comment

A string to associate with the CompositionObject.

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

(Inherited from CompositionObject)
Compositor

The Compositor used to create this CompositionObject.

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

(Inherited from CompositionObject)
Dispatcher

The dispatcher for the CompositionObject.

(Inherited from CompositionObject)
DispatcherQueue

Gets the DispatcherQueue for the CompostionObject.

Equivalent WinUI property: Microsoft.UI.Composition.CompositionObject.DispatcherQueue.

(Inherited from CompositionObject)
ImplicitAnimations

The collection of implicit animations attached to this object.

Equivalent WinUI property: Microsoft.UI.Composition.CompositionObject.ImplicitAnimations.

(Inherited from CompositionObject)
PixelFormat

The pixel format of the drawing surface.

Equivalent WinUI property: Microsoft.UI.Composition.CompositionDrawingSurface.PixelFormat.

Properties

The collection of properties associated with the CompositionObject.

Equivalent WinUI property: Microsoft.UI.Composition.CompositionObject.Properties.

(Inherited from CompositionObject)
Size

The size of the drawing surface.

Equivalent WinUI property: Microsoft.UI.Composition.CompositionDrawingSurface.Size.

SizeInt32

The size of the drawing surface.

Equivalent WinUI property: Microsoft.UI.Composition.CompositionDrawingSurface.SizeInt32.

Methods

Close()

Closes the CompositionObject and releases system resources.

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

(Inherited from CompositionObject)
ConnectAnimation(String, CompositionAnimation)

Connects and animation.

(Inherited from CompositionObject)
DisconnectAnimation(String)

Disconnects an animation.

(Inherited from CompositionObject)
Dispose()

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

(Inherited from CompositionObject)
PopulatePropertyInfo(String, AnimationPropertyInfo)

Defines a property that can be animated.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionObject.PopulatePropertyInfo.

(Inherited from CompositionObject)
Resize(SizeInt32)

Resizes the drawing surface to the specified size.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionDrawingSurface.Resize.

Scroll(PointInt32)

Scrolls the drawing surface.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionDrawingSurface.Scroll.

Scroll(PointInt32, RectInt32)

Scrolls the drawing surface.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionDrawingSurface.Scroll.

ScrollWithClip(PointInt32, RectInt32)

Scrolls the drawing surface using the specified clip rectangle.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionDrawingSurface.ScrollWithClip.

ScrollWithClip(PointInt32, RectInt32, RectInt32)

Scrolls the drawing surface with the specified clip rectangle.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionDrawingSurface.ScrollWithClip.

StartAnimation(String, CompositionAnimation)

Connects an animation with the specified property of the object and starts the animation.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionObject.StartAnimation.

(Inherited from CompositionObject)
StartAnimationGroup(ICompositionAnimationBase)

Starts an animation group.

The StartAnimationGroup method on CompositionObject lets you start CompositionAnimationGroup. All the animations in the group will be started at the same time on the object.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionObject.StartAnimationGroup.

(Inherited from CompositionObject)
StopAnimation(String)

Disconnects an animation from the specified property and stops the animation.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionObject.StopAnimation.

(Inherited from CompositionObject)
StopAnimationGroup(ICompositionAnimationBase)

Stops an animation group.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionObject.StopAnimationGroup.

(Inherited from CompositionObject)
TryGetAnimationController(String)

Returns an AnimationController for the animation running on the specified property.

Equivalent WinUI method: Microsoft.UI.Composition.CompositionObject.TryGetAnimationController.

(Inherited from CompositionObject)

Applies to

See also