Roku Developer Program

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

Sizing a Poster from a larger image


I've been working on a project for a while, and I'm trying to use animation to fade between Posters.  That part works. 

I'm having problems properly sizing the Posters...

I test on HD, and on SD.  The HD works, but the scaling produces poor image quality.  In SD, the image is not scaled at all to the right size.

If I set the image to , scaling works perfectly. 

In SD....

        <Poster id="P1" translation="[0,0]" loadDisplayMode="scaleToFit" />

    di = CreateObject("roDeviceInfo")
    DS = di.GetDisplaySize()
    m.DisplaySize_h = DS["h"]
    m.DisplaySize_w = DS["w"]

    m.P1.height = m.DisplaySize_h
    m.P1.width = m.DisplaySize_w
    m.P1.uri = m.url
    print m.P1.height   ' 480
    print m.P1.width     ' 720

The image is smashed to the upper left...

If I set         <Poster id="P1" translation="[0,0]" loadDisplayMode="scaleToFit" width="1280" height="480" />
and not use the sizing code I added, the image is centered...

What am i doing wrong?  I have a small zip of the app available..

0 Kudos
6 Replies
Level 21

Re: Sizing a Poster from a larger image

Have you tried adding ui_resolutions=hd to your manifest?  You should be able to just design for HD and let the firmware handle scaling for other resolutions.

0 Kudos
Level 7

Re: Sizing a Poster from a larger image

Hello JT,

Yes, I have also tried fhd...

Here is my manafest file..








If I don't set a size to Poster (in the tag, or programmatically), the image is full resolution, off the screen.  I've tried variouloadDisplayMode settings, too.

I'm just scratching my head.
0 Kudos
Level 10

Re: Sizing a Poster from a larger image

If you are specifying sd,hd,fhd then you'll have to handle all the resolutions yourself.  It's much easier to simply specify hd and treat every screen as 1280x720 for setup and let roku resize it for you automagically.
0 Kudos
Level 7

Re: Sizing a Poster from a larger image

Hello destruk, I'll give that a shot.  Thanks!
0 Kudos
Level 10

Re: Sizing a Poster from a larger image

It's the same thing renojim said, just a different way, so hopefully you understood. Smiley Wink
0 Kudos
Level 10

Re: Sizing a Poster from a larger image

You must always have a width and height included to use to loadDisplayMode properly.

What you may want to do is something similar to this:

width="1280" 'the actual width 
height="480" 'the actual width
loadWidth="690" 'the actual width you want to load 
loadHeight="240" 'the actual height you want to load
0 Kudos