<TFT:Label Name='ExampleLabel1'><TFT:ImagesToShow >
Can contain a number of ImageToShowItem(s) for showing images on top of the label. The shown image depends on the value in the label.
Properties
ImageLocation
Value: | String in format “X,Y” where X and Y are both unsigned integers. |
Description: | The location of the image to show is relative to the location of the label and is drawn inside the label. If the location is 0,0 the image will be drawn in the top most and left most corner of the label. The size of the label must therefore be large enough to hold the image. |
TextLocation
Value: | String in format “X,Y” where X and Y are both unsigned integers. |
Description: | The relative location of the text to write inside the label. The text to show is decided by the content of the label’s FormattedText property. |
Example:
This example shows a batteryindicator that shows the colour image depending on the values in the RangeMin and RangeMax attributes.
•The red image is used when the battery voltage in the formatted text is between 2 and 11.7 volt
•The yellow image is used when the battery voltage in the formatted text is between 11.8 and 11.9 volt
•The green image is used when the battery voltage in the formatted text is between 11.2 and 13.2 volt
•The loading image would be used when the battery voltage in the formatted text is between 13.3 and 15 volt.
However; this image is not used as the showValue is set to false!
<TFT:Label Name="BatteryVoltageLabel" FormattedText="@s@P0@ Volt" Location="700,35"
Size="70,40" Font="Arial, 9pt, style=Regular">
<TFT:ImagesToShow ImageLocation="0,0" TextLocation="5, 7">
<TFT:ImageToShowItem ShowValue="True" RangeMin="2" RangeMax="11.7"
TransparentPixel="0,0"
ImagePath='\Storage Card\Media\Indicator\BatteryRed.png'/>
<TFT:ImageToShowItem ShowValue="True" RangeMin="11.8" RangeMax="11.9"
TransparentPixel="0,0"
ImagePath='\Storage Card\Media\Indicator\BatteryYellow.png'/>
<TFT:ImageToShowItem ShowValue="True" RangeMin="12" RangeMax="13.2"
TransparentPixel="0,0"
ImagePath='\Storage Card\Media\Indicator\BatteryGreen.png'/>
<TFT:ImageToShowItem ShowValue="False" RangeMin="13.3" RangeMax="15"
TransparentPixel="0,0"
ImagePath='\Storage Card\Media\Indicator\BatteryLoading.png'/>
</TFT:ImagesToShow>
</TFT:Label>