このページでは

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.Stretch - 画像を拡大・縮小して、利用可能な領域に収まるようにします。
  • BorderImage.Repeat - 空き領域がなくなるまで画像をタイル状に並べます。最後の画像が切り取られる場合があります。
  • BorderImage.Round - 「Repeat」と同様ですが、最後の画像がトリミングされないように画像を縮小します。

各プロパティのデフォルトのタイルモードは、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.