Dela via


Compositor.CreateSurfaceBrush Method

Definition

Overloads

CreateSurfaceBrush()

Creates an instance of CompositionSurfaceBrush.

CreateSurfaceBrush(ICompositionSurface)

Creates an instance of CompositionSurfaceBrush using the specified composition surface.

CreateSurfaceBrush()

Creates an instance of CompositionSurfaceBrush.

public:
 virtual CompositionSurfaceBrush ^ CreateSurfaceBrush() = CreateSurfaceBrush;
/// [Windows.Foundation.Metadata.Overload("CreateSurfaceBrush")]
CompositionSurfaceBrush CreateSurfaceBrush();
[Windows.Foundation.Metadata.Overload("CreateSurfaceBrush")]
public CompositionSurfaceBrush CreateSurfaceBrush();
function createSurfaceBrush()
Public Function CreateSurfaceBrush () As CompositionSurfaceBrush

Returns

Returns the created CompositionSurfaceBrush object.

Attributes

Windows requirements

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

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

Applies to

CreateSurfaceBrush(ICompositionSurface)

Creates an instance of CompositionSurfaceBrush using the specified composition surface.

public:
 virtual CompositionSurfaceBrush ^ CreateSurfaceBrush(ICompositionSurface ^ surface) = CreateSurfaceBrush;
/// [Windows.Foundation.Metadata.Overload("CreateSurfaceBrushWithSurface")]
CompositionSurfaceBrush CreateSurfaceBrush(ICompositionSurface const& surface);
[Windows.Foundation.Metadata.Overload("CreateSurfaceBrushWithSurface")]
public CompositionSurfaceBrush CreateSurfaceBrush(ICompositionSurface surface);
function createSurfaceBrush(surface)
Public Function CreateSurfaceBrush (surface As ICompositionSurface) As CompositionSurfaceBrush

Parameters

surface
ICompositionSurface

The composition surface to associate with the CompositionSurfaceBrush.

Returns

Returns the created CompositionSurfaceBrush object.

Attributes

Windows requirements

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

See also

Applies to