Image from OH item value - with scaling

Hi,

How do I add a widget that loads the image from an OH item and scales the element to screen width? When I use dummy widget with a large image (movie poster) it gets displayed “outside” my habpanel view.

Best regards,
Patrik

You can use a template widget with this code:

<img src="{{itemValue('ImageURL')}}" style="width: 100%; height: 100%" />

Be sure to enable the “Don’t wrap in container” option.
(ImageURL is the name of the item in this case)

1 Like

Why is it bad to wrap it in a container. Would the div have another size, margin or padding and leave a border around the image?