2

i need to set a image-view it should have the square curve round at the edges ,How to do this can anyone send me some solution to do this

Vendetta
  • 513
  • 2
  • 16

1 Answers1

2

Cascades qml does not support borders or rounded corners. Unless someone has a better solution what I've done is to wrap the imageview in a container and use a 9-slice image for the container background.

A rough example:

Container {
    topPadding: 5
    leftPadding: 5
    rightPadding: 5
    bottomPadding: 5
    background: mybackground.imagePaint
    ImageView {
        imageSource: "asset:///images/image1.png"
    }
    attachedObjects: [
        ImagePaintDefinition {
            id: mybackground
            imageSource: "asset:///images/bgimage.amd"
        }
    ]
}

Adjust the padding as needed for thinner/thicker border.

hyarion
  • 2,251
  • 2
  • 17
  • 28