ColorOverlay
ImportStatement: import QtGraphicalEffects 1.0
Since: QtGraphicalEffects 1.0
Inherits: Item
Properties
cached :bool
color :color
source :variant
DetailedDescription
效果类似于彩色玻璃上的彩色图像。
源 | 影响 |
---|---|
| |
importQtQuick 2.0实现代码:
importQtGraphicalEffects 1.0
Item {
width: 300
height: 300
Image {
id: bug
source:"images/butterfly.png"
sourceSize: Qt.size(parent.width,parent.height)
smooth: true
visible: false
}
ColorOverlay {
anchors.fill: bug
source: bug
color: "#80800000"
}
}
PropertyDocumentation
cached :bool
输出是否缓存,可提高渲染性能,但消耗更多内存。每当源和影响属性变化,缓冲都将更新。如果源或属性是动态的,推荐关闭缓存。默认为假。
color :color
RGBA值用于彩色玻璃的颜色。默认设置为"transparent"(透明的)。
不同颜色的影响 | ||
---|---|---|
| | |
color: #80ff0000 | color: #8000ff00 | color: #800000ff |