ImageLayer QML Type

A layer consisting of a single image. More...

Import Statement: import QtQuickUltralite.Layers
Since: Qt Quick Ultralite 1.7



Detailed Description

Defines a layer with a single image source. ImageFiles.MCU.Experimental.resourceSplitImageOptimization has to be disabled for the provided image.

Image layers can be used to present static image data from flash to the screen, without allocating memory for a dynamic framebuffer.

ImageLayer items have to be contained inside Screen or SpriteLayer items.

Example usage:

ApplicationScreens {
    Screen {
        ImageLayer {
            source: "qrc:/images/background.png"

Note: This feature may not be supported by hardware on all reference boards. For more information, see Supported Features table.

Note: This type is specific to Qt Quick Ultralite. See also the compatibility page.

See also ApplicationScreens, Screen, ItemLayer, SpriteLayer, and Improving performance using hardware layers.

Property Documentation

platformId : int

A unique value to identify the layer to the platform.

For use with platform specific API to set custom layer properties.

renderingHints : enumeration

The rendering optimization hints for the image layer.

The hints are used by the platform layer engine to configure the layer in the most optimal way for the application. The default rendering hints is platform-specific. If no default is provided by the platform, LayerBase.OptimizeForSize is used.

Possible values:

LayerBase.NoRenderingHintNo rendering hint specified
LayerBase.OptimizeForSpeedThe layer is optimized for fast rendering
LayerBase.OptimizeForSizeThe layer is optimized for low memory usage

source : image

As the url QML basic type is not supported, there exists an another basic type called image which is the type of the ImageLayer object's source property.

ImageLayer accepts an absolute resource URI, for example "qrc:/images/map.png". The resource must have been compiled with qulrcc tool to be available.

If a string that is not known at compile-time will be set as a source Qt Quick Ultralite will perform run-time lookup to find the resource handle for the given string.

For example the following code results in runtime lookup:

ImageLayer {
    source: "qrc:/" + "foo.png"

A failed lookup resets the source property to an empty state in which nothing is rendered.

It's recommended to not use images that are compressed or configured with the OnDemand cache policy, as they are stored on the image cache. These images might be removed if the image cache is not big enough to fit all the relevant images, leading to unexpected results.

Note: Qt Quick Ultralite does not support dynamic resources. Every resource must be registered using the Qt Quick Ultralite resource system.

See also Managing Resources and Dealing with image resources.

Available under certain Qt licenses.
Find out more.