Compositor.CreateSurfaceBrush 方法

定义

重载

CreateSurfaceBrush()

创建 CompositionSurfaceBrush 的实例。

CreateSurfaceBrush(ICompositionSurface)

使用指定的合成图面创建 CompositionSurfaceBrush 的实例。

CreateSurfaceBrush()

创建 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

返回

返回创建的 CompositionSurfaceBrush 对象。

属性

示例

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;

另请参阅

适用于

CreateSurfaceBrush(ICompositionSurface)

使用指定的合成图面创建 CompositionSurfaceBrush 的实例。

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

参数

返回

返回创建的 CompositionSurfaceBrush 对象。

属性

另请参阅

适用于