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: 
SrBIOS
Visitor

Sizing a Poster from a larger image

Hello,

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 m.top.backgroundURI , 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..

Thanks!
0 Kudos
6 REPLIES 6
renojim
Community Streaming Expert

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.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
SrBIOS
Visitor

Re: Sizing a Poster from a larger image

Hello JT,

Yes, I have also tried fhd...

Here is my manafest file..

title=DS

major_version=1
minor_version=0
build_version=00000

mm_icon_focus_hd=pkg:/images/mm_icon_focus_hd.png
mm_icon_focus_sd=pkg:/images/mm_icon_focus_sd.png

splash_screen_sd=pkg:/images/splash_screen_sd.png
splash_screen_hd=pkg:/images/splash_screen_hd.png
splash_screen_fhd=pkg:/images/splash_screen_fhd.png

splash_color=#01A3E9
splash_min_time=1000

#ui_resolutions=sd,hd
ui_resolutions=sd,hd,fhd

#splash_rsg_optimization=1


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.
[/color]
0 Kudos
destruk
Streaming Star

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.
SrBIOS
Visitor

Re: Sizing a Poster from a larger image

Hello destruk, I'll give that a shot.  Thanks!
0 Kudos
destruk
Streaming Star

Re: Sizing a Poster from a larger image

It's the same thing renojim said, just a different way, so hopefully you understood. 😉
0 Kudos
norcaljohnny
Roku Guru

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:


loadDisplayMode="scaleToFit"
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
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.