Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rynop
Visitor

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
Roku Guru

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
Visitor

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
Visitor

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.