CrossFadeImage

An Image like component which smoothly fades when its source is updated. More...

Properties

Detailed Description

import QtQuick 2.0
import Ubuntu.Components 0.1

CrossFadeImage {
    width: units.gu(100)
    height: units.gu(75)
    source: "http://design.ubuntu.com/wp-content/uploads/ubuntu-logo14.png"
    fadeDuration: 1000
    MouseArea {
        anchors.fill: parent
        onClicked: parent.source = "http://design.ubuntu.com/wp-content/uploads/canonical-logo1.png"
    }
}

Property Documentation

fadeDuration : int

The time over which to fade between images. Defaults to UbuntuAnimation.FastDuration.

See also UbuntuAnimation.


fillMode : enumeration

Defaults to Image.PreserveAspectFit.

  • Image.Stretch - the image is scaled to fit
  • Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping
  • Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary
  • Image.Tile - the image is duplicated horizontally and vertically
  • Image.TileVertically - the image is stretched horizontally and tiled vertically
  • Image.TileHorizontally - the image is stretched vertically and tiled horizontally
  • Image.Pad - the image is not transformed

read-onlyrunning : bool

Whether the animation is running


source : url

The image being displayed. Can be a URL to any image format supported by Qt.


read-onlysourceSize : size

The actual width and height of the loaded image


read-onlystatus : enumeration

This property holds the status of image loading. It can be one of:

  • Image.Null - no image has been set
  • Image.Ready - the image has been loaded
  • Image.Loading - the image is currently being loaded
  • Image.Error - an error occurred while loading the image