ImageLayer QML Type

A layer consisting of a single image. 更多...

导入语句: import QtQuickUltralite.Layers .
Since: Qt Quick Ultralite 1.7
继承:

Item

特性

详细描述

Defines a layer with a single image source. QUL_INTERNAL_SPLIT_IMAGE_OPTIMIZATION 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 {
    source: "qrc:/images/background.png"
}
						

注意: This type is specific to Qt Quick Ultralite. See also the compatibility 页面。

另请参阅 应用程序 , Screen , ItemLayer , SpriteLayer ,和 使用硬件层改善性能 .

特性文档编制

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.

可能的值:

常量 描述
LayerBase.OptimizeForSpeed The layer is optimized for fast rendering
LayerBase.OptimizeForSize The 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 特性。

ImageLayer accepts an absolute resource URI, for example "qrc:/images/map.png". The resource must have been compiled with qulrcc 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.

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

另请参阅 管理资源和资产 and Dealing with image resources .