Ability to specify poster image height only

I have a screen graph app, and I want to display a logo where I want to only specify the height and let the roku compute the width preserving aspect ratio.

How can I do this? According to the docs I figured this would work but it is not:

<Poster
    id="headerLogo"
    uri="pkg:/images/header-logo.png"
    loadHeight="80"
    loadDisplayMode="scaleToFill"
/>

Did you try without “scaleToFill” ?

distorting the image if the target screen element area has a different aspect ratio than the image

Try removing that or try some of the other “loadDisplayMode” options

I ended up doing this:

<Poster
 loadHeight="80"
 loadWidth="960"
 loadDisplayMode="scaleToFit"
 uri="pkg:/images/header-logo.png"
        />

I had to add a loadWidth, not sure why as it is totally ignored. Seems like a hack.

“rynop” wrote:
I ended up doing this:


This magically worked for me as well. If the docs are telling the truth, then this is definitely a hack. It states very clearly “maintains aspect ratio”, so that would indicate that width or heights counterpart does NOT need to be set. But setting it makes it work… :slightly_smiling_face: