Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rynop
Level 7

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"
/>
0 Kudos
3 REPLIES 3
joetesta
Level 11

Re: Ability to specify poster image height only

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
aspiring
0 Kudos
rynop
Level 7

Re: Ability to specify poster image height only

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.
0 Kudos
neoRiley
Level 7

Re: Ability to specify poster image height only

"rynop" wrote:
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.

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... 🙂
0 Kudos