Desaturate
ImportStatement: import QtGraphicalEffects 1.0
Since: QtGraphicalEffects 1.0
Inherits: Item
Properties
cached :bool
desaturation: real
source :variant
DetailedDescription
Desaturated组件的像素值计算做源实例的原始RGB组件的平均值。
| 源 | 影响 |
|---|---|
|
|
|
importQtQuick 2.0相应代码:
importQtGraphicalEffects 1.0
Item {
width: 300
height: 300
Image {
id: bug
source: "images/bug.jpg"
sourceSize: Qt.size(parent.width,parent.height)
smooth: true
visible: false
}
Desaturate {
anchors.fill: bug
source: bug
desaturation: 0.8
}
}
PropertyDocumentation
cached :bool
是否缓冲影响输出。缓冲可提高渲染效率,但会消耗更多内存。每次源或影响属性变化,都会更新缓冲。如果源或影响属性是动态的,推荐关闭缓冲。默认为假。
desaturation: real
多少源色彩被冲淡。值在0.0(不变)到1.0(冲淡)之间,默认为0
| 冲淡的影响 | ||
|---|---|---|
|
|
|
|
| desaturation: 0.0 | desaturation: 0.5 | desaturation: 1.0 |
source :variant
本文介绍 Qt Graphical Effects 1.0 中的 Desaturate 组件使用方法,通过调整 desaturation 属性实现不同等级的色彩冲淡效果。






被折叠的 条评论
为什么被折叠?



