Logo FluentUI

OpacityMask QML Type

An opacity mask shader effect. More...

Import Statement: import FluentUI.Controls 1.0

Properties

Detailed Description

OpacityMask uses a mask source item to control the opacity of a source item pixel by pixel. The luminance of each pixel in the mask determines the opacity of the corresponding pixel in the source. The effect can optionally be inverted.

Usage Example

 import QtQuick
 import FluentUI.Controls

 Rectangle {
     width: 200
     height: 200
     color: "red"
     layer.enabled: true
     layer.effect: OpacityMask {
         maskSource: Rectangle {
             width: 200
             height: 200
             radius: 100
         }
     }
 }

Property Documentation

cached : bool

Whether the shader output should be cached. When true, the effect is rendered once and cached, improving performance at the cost of memory.

invert : bool

Whether the mask effect is inverted. When true, opaque areas of the mask become transparent and vice versa.

maskSource : Item

The Item used as the opacity mask. The alpha channel of this item's rendered content determines the opacity of the source item.

source : Item

The source Item whose visibility is controlled by the mask.