ImageView QML Type

Display a colorized image from a 2D array. More...

Import Statement: import QuickGraphLib
Inherits:

Item

Inherited By:

ColorMesh

Properties

Detailed Description

See also Builtin color maps, Color mapped images, and Image alignment.

Property Documentation

mirrorHorizontally : bool

mirrorVertically : bool

Mirror the image horizontally and/or vertically.


alignment : enumeration

A bitwise or of one horizontal and one vertical flag from the following:

ConstantDescription
Qt.AlignLeftLeft align
Qt.AlignHCenterCenter align (horizontally)
Qt.AlignRightRight align
Qt.AlignTopTop align
Qt.AlignVCenterCenter align (vertically)
Qt.AlignBottomBottom align

Defaults to Qt.AlignCenter (which is Qt.AlignHCenter | Qt.AlignVCenter).

See also Qt::AlignmentFlag.


autoMax : bool

Whether the maximum value for the colormap should be determined from source. Defaults to true.

See also ImageView::max.


autoMin : bool

Whether the minimum value for the colormap should be determined from source. Defaults to true.

See also ImageView::min.


colormap : var

The colormap to use when source is a list of values. This property can either take a Gradient, or a color map enumeration value from ColorMaps.

The values of source are mapped to a color using min and max (i.e. if the value is less than or equal to min, it will be assigned the value at 0; if the value is greater than or equal to max, it will be assigned the value at 1). To invert a colormap, swap the values of min and max.

The default colormap is grayscale.

Note: This property has no effect when source is a QImage.

See also ColorMaps::colors.


fillMode : enumeration

One of the following:

ConstantDescription
Qt.IgnoreAspectRatioStretch the image to fill
Qt.KeepAspectRatioPreserve the aspect ratio
Qt.KeepAspectRatioByExpandingPreserve the aspect ratio by cropping

Defaults to Qt.IgnoreAspectRatio.

See also Qt::AspectRatioMode.


max : real

The value which is mapped to 1 on the colormap. If autoMax is set, this property will update to the maximum value of source.


min : real

The value which is mapped to 0 on the colormap. If autoMin is set, this property will update to the minimum value of source.


paintedRect : rect [read-only]

The rect that the image is painted in, in the ImageView's own coordinate space. If fillMode is Qt.IgnoreAspectRatio, this will equal Qt.rect(0, 0, width, height).


smooth : bool

Sets whether the displayed image should be pixelated or smooth (linearly interpolated). Unlike other Items, this property defaults to false.


source : var

The data source for the displayed image. This can be a QImage, or a 1D/2D list of reals.

If a list is provided, it will be converted to a color image using the colormap. A 1D list will be converted to a 2D list using sourceSize. The 2D data will be interpreted using "image" indexing (i.e. the first axis is Y and the second axis is X). If your data uses the opposite indexing scheme, use the transpose property to correct it.


sourceSize : size

The size of source. When source is a 1D list, this property can be set to the size the list should be interpreted as.


transpose : bool

Transpose the image.