Kodi Development  20.0
for Binary and Script based Add-Ons
Subclass - ControlImage

Detailed Description

Used to show an image.

Class: ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])

The image control is used for displaying images in Kodi. You can choose the position, size, transparency and contents of the image to be displayed.

Note
This class include also all calls from Control
Parameters
xinteger - x coordinate of control.
yinteger - y coordinate of control.
widthinteger - width of control.
heightinteger - height of control.
filenamestring - image filename.
aspectRatio[opt] integer - (values 0 = stretch (default), 1 = scale up (crops), 2 = scale down (black bar)
colorDiffusehexString - (example, '0xC0FF0000' (red tint))
Note
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
After you create the control, you need to add it to the window with addControl().

Example:

...
# ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])
self.image = xbmcgui.ControlImage(100, 250, 125, 75, aspectRatio=2)
...

Function Documentation

◆ setImage()

setImage (   ...)

Function: setImage(filename[, useCache])


Changes the image.

Parameters
filenamestring - image filename.
useCache[opt] bool - True=use cache (default) / False=don't use cache.

v13 Python API changes:
Added new option useCache.

Example:

...
# setImage(filename[, useCache])
self.image.setImage('special://home/scripts/test.png')
self.image.setImage('special://home/scripts/test.png', False)
...

◆ setColorDiffuse()

setColorDiffuse (   ...)

Function: setColorDiffuse(colorDiffuse)


Changes the images color.

Parameters
colorDiffusehexString - (example, '0xC0FF0000' (red tint))

Example:

...
# setColorDiffuse(colorDiffuse)
self.image.setColorDiffuse('0xC0FF0000')
...