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

roParagraphScreen.AddGraphic() - what's the default fit?

roParagraphScreen has two methods for adding an image:
  • AddGraphic(url as String)

  • AddGraphic(url as String, displayMode as String)

Where displayMode can be one of
  • "scale-to-fill" - marked "(Default)"

  • "scale-to-fit." - typo*

  • "zoom-to-fill"

  • "photo-fit"

My question is what is the default display mode that is used by AddGraphic, i.e. with no param or invalid displayMode? It is not "scale-to-fill", contrary to what doc says. Rather, for the image i have it seems to show it 1:1 (no scale) but chomps about 1/3 from top and 1/3 from bottom. It is not photo-fit either.

(*) This is extra strange: see the extra period "." at after scale-to-fit? That is exactly how it is spelled everywhere in the documentation. That spelling is nothing if not consistent. But apparently that's a typo that got copy&pasted 7 times, since parameter does not work with the dot at the end.
0 Kudos
5 REPLIES 5
dcrandall
Visitor

Re: roParagraphScreen.AddGraphic() - what's the default fit?

So, kind of a question, is there a way I could either:
a) Position the .addGraphic to not have a mystery 15-20 pixel line underneath the logo/banner?
b) Draw over the top of an roParagraphScreen with an 'roScreen' that works like I want it to?
0 Kudos
RokuKC
Roku Employee
Roku Employee

Re: roParagraphScreen.AddGraphic() - what's the default fit?

"EnTerr" wrote:

My question is what is the default display mode that is used by AddGraphic, i.e. with no param or invalid displayMode? It is not "scale-to-fill", contrary to what doc says. Rather, for the image i have it seems to show it 1:1 (no scale) but chomps about 1/3 from top and 1/3 from bottom. It is not photo-fit either.


You are correct... it appears that 1:1 scaling will be used in this case. If it is not documented I would not rely on that as a feature though.
0 Kudos
EnTerr
Roku Guru

Re: roParagraphScreen.AddGraphic() - what's the default fit?

"RokuKC" wrote:
You are correct... it appears that 1:1 scaling will be used in this case. If it is not documented I would not rely on that as a feature though.

@RokuKC - do you mean that ifParagraphScreen.AddGraphic(url as String) method should not be used?
(that's the version without displayMode param, it has existed first)

What i am trying to do is using one of the standard screens to show limited text and an image. It seems as if image on screen will be limited to about 1/3 of the available space (and there is no way to configure that) - but i am more concerned about showing the image of unknown-in-advance size on the screen rather than perfect fit.

@dcrandall -
a) i doubt there is any way to change anything about the .addGraphic() bounding box
b) you cannot use roScreen on top of any other standard screen - it's completely separate (you have to reject standard screens during roScreen lifetime)
0 Kudos
RokuKC
Roku Employee
Roku Employee

Re: roParagraphScreen.AddGraphic() - what's the default fit?

"EnTerr" wrote:

@RokuKC - do you mean that ifParagraphScreen.AddGraphic(url as String) method should not be used?
(that's the version without displayMode param, it has existed first)


Sorry, I was more focused on the bit about what happens when a unrecognized display mode is passed to AddGraphic explicitly. 🙂
AddGraphic without an explicit display mode is fine and should display the image unscaled.

Passing an empty string explicitly as display mode should have the same effect, but if that is your intention I recommend calling AddGraphic without the display mode parameter.
0 Kudos
EnTerr
Roku Guru

Re: roParagraphScreen.AddGraphic() - what's the default fit?

"RokuKC" wrote:
Sorry, I was more focused on the bit about what happens when a unrecognized display mode is passed to AddGraphic explicitly. 🙂
AddGraphic without an explicit display mode is fine and should display the image unscaled.

Passing an empty string explicitly as display mode should have the same effect, but if that is your intention I recommend calling AddGraphic without the display mode parameter.

I see, so here there is a 5th mode, "" - which is the default. "scale-to-fill" being labeled as "(Default)" was contributing to my confusion.
Thanks for re-clarifying.
0 Kudos