이 페이지에서

BorderImageMesh QML Type

BorderImage 와 같은 방식으로 정점이 배열된 메쉬를 정의합니다. 더 보기...

Import Statement: import QtQuick

속성

상세 설명

BorderImageMesh는 비용이 많이 들 수 있는 ShaderEffectSource 를 사용할 필요 없이, ShaderEffect 에 BorderImage 와 유사한 기능을 제공합니다.

다음은 기능적으로 동등합니다:

BorderImage {
    id: borderImage
    border {
        left: 10
        right: 10
        top: 10
        bottom: 10
    }
    source: "myImage.png"
    visible: false
}
ShaderEffectSource {
    id: effectSource
    sourceItem: borderImage
    visible: false
}
ShaderEffect {
    property var source: effectSource
    ...
}
Image {
    id: image
    source: "myImage.png"
    visible: false
}
ShaderEffect {
    property var source: image
    mesh: BorderImageMesh {
        border {
            left: 10
            right: 10
            top: 10
            bottom: 10
        }
        size: image.sourceSize
    }
    ...
}

하지만 BorderImageMesh 버전은 일반적으로 더 잘 최적화될 수 있습니다.

속성 설명

border group

border.bottom : int

border.left : int

border.right : int

border.top : int

아래 그림과 같이 4개의 테두리 선(가로 2개, 세로 2개)이 이미지를 9개의 구역으로 나눕니다:

점선 테두리 선으로 9개의 번호가 매겨진 영역으로 나뉜 붉은색 둥근 사각형

각 경계선(왼쪽, 오른쪽, 위쪽, 아래쪽)은 메쉬의 해당 가장자리로부터의 픽셀 단위 오프셋을 지정합니다. 기본적으로 각 경계선의 값은 0입니다.

예를 들어, 다음 정의는 하단 선을 메쉬 하단에서 10픽셀 위로 설정합니다:

BorderImageMesh {
    border.bottom: 10
    // ...
}

horizontalTileMode : enumeration

verticalTileMode : enumeration

이 속성은 이미지의 중간 부분을 반복하거나 늘리는 방법을 설명합니다.

  • BorderImage.늘리기 - 이미지를 사용 가능한 영역에 맞게 크기를 조정합니다.
  • BorderImage.반복 - 공간이 더 이상 남지 않을 때까지 이미지를 타일 형태로 반복합니다. 마지막 이미지가 잘릴 수 있습니다.
  • BorderImage.Round - '반복'과 유사하지만, 마지막 이미지가 잘리지 않도록 이미지의 크기를 축소합니다.

각 속성의 기본 타일 모드는 BorderImage.Stretch입니다.

size : size

메시의 기본 크기입니다. 이는 일반적으로 ShaderEffect 에서 사용하는 이미지의 sourceSize 에 해당합니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.