ID2D1CommandSink::FillOpacityMask 方法 (d2d1_1.h)

在命令接收器上填充不透明度掩码。

语法

HRESULT FillOpacityMask(
  [in]           ID2D1Bitmap       *opacityMask,
  [in]           ID2D1Brush        *brush,
  [in, optional] const D2D1_RECT_F *destinationRectangle,
  [in, optional] const D2D1_RECT_F *sourceRectangle
);

参数

[in] opacityMask

类型: ID2D1Bitmap*

将对其 alpha 通道进行采样以定义不透明度掩码的位图。

[in] brush

类型: ID2D1Brush*

用于填充蒙板的画笔。

[in, optional] destinationRectangle

类型: const D2D1_RECT_F*

要在其中填充掩码的目标矩形。 如果未指定,则为原点。

[in, optional] sourceRectangle

类型: const D2D1_RECT_F*

不透明度掩码中的源矩形。 如果未指定,则为整个掩码。

返回值

类型: HRESULT

如果方法成功,则返回 S_OK。 如果失败,则返回 HRESULT 错误代码。

注解

必须将不透明度掩码位图视为固定在每个轴上。

要求

要求
最低受支持的客户端 适用于 Windows 7 的Windows 8和平台更新 [桌面应用 |UWP 应用]
最低受支持的服务器 适用于 Windows Server 2008 R2 的Windows Server 2012和平台更新 [桌面应用 |UWP 应用]
目标平台 Windows
标头 d2d1_1.h
DLL D2d1.dll

另请参阅

ID2D1CommandList::Stream

ID2D1CommandSink

ID2D1RenderTarget::FillOpacityMask