C

ImageFiles.MCU.resourceAnimatedSpriteOptimizations

Description

It enables the cropping image optimization for the chosen mode. With cropping image optimization technique, only the changed regions of an image are rendered.

The following is the list of optimization modes that can be chosen from:

  • "Crop" - render only the changed regions compared to the earlier frame (for devices that implement single buffering strategy).
  • "CropWithPartialUpdates" - render only the changed regions since the last two frames (for devices that implement double buffering strategy).

To apply the optimization, size of the sprite animation frames should be known at compile-time. An AnimatedSprite item can be given a size using the ImageFiles.MCU.resourceAnimatedSpriteFrameHeight and ImageFiles.MCU.resourceAnimatedSpriteFrameWidth properties.

Warning: The optimization supports only the opaque images without blending on top. Also, the optimization should only be used when the sprite animation runs uninterrupted from start to finish. No other animations or visual updates should be happening while the AnimatedSprite is visible, unless they are triggered by the AnimatedSprite::currentFrame property so that they happen on the same frame that the sprite animation is advanced.

Cropping image optimization always optimizes performance and may decrease memory footprint. When it is enabled, qulrcc disables the default image optimization that it applies. The default image optimization may result in a smaller binary size compared to the cropping image optimization in some cases (especially for a double buffering strategy).

Usage

This property is accepted in any context where its parent node is accepted. It takes a string or a list of non-empty strings.

The available options are:

  • "Crop"
  • "CropWithPartialUpdates"

Code example:

    ImageFiles {
        files: [
            "qt-image-sequence.png"
        ]
        MCU.resourceAnimatedSpriteFrameWidth: 180
        MCU.resourceAnimatedSpriteFrameHeight: 160
        MCU.resourceAnimatedSpriteOptimizations: "CropWithPartialUpdates"
    }

Since

This property was introduced in Qt Quick Ultralite 2.5.

See also Managing Resources.

Available under certain Qt licenses.
Find out more.