Item {//一个圆形图片
    width: parent.width
    height: parent.height
    Image {
        id: rdJpg
        anchors.centerIn: parent
        smooth: true
        visible: false
        source: "qrc:/img/rd.jpg"
    }
    Rectangle {
        id: mask
        width: parent.width
        height: parent.height
        radius: width/2
        visible: false
    }
    OpacityMask {
        anchors.fill: parent
        source: rdJpg
        maskSource: mask
    }
}

需要:

import QtGraphicalEffects 1.0

 

 

QML显示圆形图片

 

相关文章:

  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-09-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2021-11-16
  • 2021-12-04
  • 2021-04-14
相关资源
相似解决方案