Let me start with the premise of using roGridScreen and wanting to show text within each “poster” for the categories/items. SDPosterUrl/HDPosterUrl properties for each item instead expect URL to an image. And I don’t have that image pre-rendered, assume text is dynamic and making round-trip to external server to render it is unavailable.
So i wonder, is there a way to generate images to tmp:/ so they can be referred by posterUrl?
Something like roBitmap and/or roRegion having save() method that can produce a JPG or PNG?!
ifDraw2d (page 56 of Brightscript manual) has a GetByteArray() method which should give you an robytearray which you can write to tmp:/ using ifByteArray functions (see page 49 of Brightscript manual)
I haven’t tried this myself, so this is just information use at your own risk.
Writing a byte array directly to disk would result in a raw bitmap, if I’m not mistaken. Do the built-in screens support bmp in addition to jpg, png, and gif? I’ve had a need for this myself, actually, but haven’t had the opportunity to test it out, yet.
Just checked, looks like setbytearray has not yet been implemented, so it would appear that librokudev is the only option, other than pushing the raw data to a server, converting it and downloading again.
“RokuJoel” wrote:
Just checked, looks like setbytearray has not yet been implemented, so it would appear that librokudev is the only option, other than pushing the raw data to a server, converting it and downloading again.
Thanks for the ideas, Joel -
Did you mean getByteArray() from the documentation is not implemented? (And if it’s not implemented, how can i even convert text&font to a raw bitmap?!)
Can you put a feature request for this to be done? I.e. allow saving image locally in a format which is both easy to implement and roGridScreen&co will feel comfortable as poster (i seem to remember it may take PNG/GIF but will convert to JPG) - or alternatively have a way to provide TEXT as poster blot
Did you mean getByteArray() from the documentation is not implemented? (And if it’s not implemented, how can i even convert text&font to a raw bitmap?!)
No, just that there is no (fast) way to reverse the process of converting a byte array to a bitmap… at least that is my understanding.
“EnTerr” wrote:
2. Can you put a feature request for this to be done? I.e. allow saving image locally in a format which is both easy to implement and roGridScreen&co will feel comfortable as poster (i seem to remember it may take PNG/GIF but will convert to JPG) - or alternatively have a way to provide TEXT as poster blot
The request is already in the system, just followed up, the more really useful use-cases for this sort of thing there are, the higher likelihood of it actually happening.
“RokuJoel” wrote:
No, just that there is no (fast) way to reverse the process of converting a byte array to a bitmap… at least that is my understanding.
Well there is the constructor CreateObject(“roBitmap”, String filename) that can load files. But this reverse process does not concern me, since it does not relate to my case.
“RokuJoel” wrote:
The request is already in the system, just followed up, the more really useful use-cases for this sort of thing there are, the higher likelihood of it actually happening.
For my case any of the two things will do: a) ability to overlay text on top (or instead) of poster image background or b) ability to save bitmaps to PNG/JPG (or whatever pleases poster screens). In my particular scenario this is to browse file system but i suppose others can chime in with other cases when it was needed.
“RokuJoel” wrote:
The request is already in the system, just followed up, the more really useful use-cases for this sort of thing there are, the higher likelihood of it actually happening.
For my case any of the two things will do: a) ability to overlay text on top (or instead) of poster image background or b) ability to save bitmaps to PNG/JPG (or whatever pleases poster screens). In my particular scenario this is to browse file system but i suppose others can chime in with other cases when it was needed.
To receive a raw framebuffer from a VNC server fro display as a VNC Client. I’ve been waiting on this one for quite a while…
Also, librokudev’s PNG libs won’t work well for this. PNG’s require compression, and while the library does allow for arbitrary PNG chunk creation (to some extent), it does not support compression itself. It’s main use was in KidPaint to change the pallete indexed color values (separate, non-compressed chunk of the file), thus changing PNG image colors without needing to pack/unpack the image itself.
“RokuJoel” wrote:
Hmm - seems like you could just pop an ImageCanvas on top of your posterscreen and display whatever you want there - text etc.
Joel
If you put an image canvas on top of a poster screen, then the image canvas will steal all of the events, so you could no longer navigate the poster screen.
“RokuJoel” wrote:
Hmm - seems like you could just pop an ImageCanvas on top of your posterscreen and display whatever you want there - text etc.
Will that text move (scroll) with the “poster” elements while user navigates left/right/up/down in roGridScreen?
No, the control shifts to the screen that is on “top” so you would have to capture the remote input in your image canvas, close the canvas, make your move on the grid with setFocusedListItem and then pop the canvas back up over the grid.
“RokuJoel” wrote:
No, the control shifts to the screen that is on “top” so you would have to capture the remote input in your image canvas, close the canvas, make your move on the grid with setFocusedListItem and then pop the canvas back up over the grid.
So no, it is no good. Inventive but useless; you are thinking of something that you needed perhaps but it does not relate to having posters with text on them and said posters moving smooth as they tend to, no jerking and some text flickering on and off on top.
Just imagine I want to show list of n>5 folders/categories by name and choose from those and I don’t know them in advance (so can’t pre-render them). Showing same generic poster of a folder or a book is bad UI in the case.
“RokuJoel” wrote:
So, what you probably need to do is create your own ui using the 2D Api’s - roScreen/roBitmap etc.
Maybe: Is there an example of that being done in BS - scrolling most of the screen smoothly and sliding new parts on screen - no matter if that is a sample or production channel?
But barring that, probably is better to focus on realistic approach like being able to save roBitmap to JPEG. A note on roGridScreen fw>2.8 says that “File types of .png and .gif files are now supported, though they are converted internally to .jpg by the roGridScreen so they have a performance penalty” so it would seem as if store-as-jpeg functionality/library is already included in the code and if it is added as roBitmap.save(), that would be a) easy and b) have broader use than text on posters.
“RokuJoel” wrote:
So, what you probably need to do is create your own ui using the 2D Api’s - roScreen/roBitmap etc.
Maybe: Is there an example of that being done in BS - scrolling most of the screen smoothly and sliding new parts on screen - no matter if that is a sample or production channel?
Take a look at the “Full CD Listening Party” in the AOL HD channel. The whole screen is rendered using BrightScript (including the horizontal scroll of the cover art carousel, and the vertical scroll of the playlist).
“EnTerr” wrote:
Maybe: Is there an example of that being done in BS - scrolling most of the screen smoothly and sliding new parts on screen - no matter if that is a sample or production channel?
Take a look at the “Full CD Listening Party” in the AOL HD channel. The whole screen is rendered using BrightScript (including the horizontal scroll of the cover art carousel, and the vertical scroll of the playlist).
Interesting - though it is only 1/3 of the screen and the selection blinks funky from selection to selection (does not stay smooth in one place like with gridScreen). i am also impressed by the track list underneath
“EnTerr” wrote:
Maybe: Is there an example of that being done in BS - scrolling most of the screen smoothly and sliding new parts on screen - no matter if that is a sample or production channel?
Take a look at the “Full CD Listening Party” in the AOL HD channel. The whole screen is rendered using BrightScript (including the horizontal scroll of the cover art carousel, and the vertical scroll of the playlist).
Interesting - though it is only 1/3 of the screen and the selection blinks funky from selection to selection (does not stay smooth in one place like with gridScreen). i am also impressed by the track list underneath
It’s actually meant to have an “elastic” scrolling effect. It’s much smoother on the Roku 2 than the Roku 1, but the lack of smooth scrolling like the grid screen is intentional, not a limitation of the roScreen or Brightscript.
“EnTerr” wrote:
how do you know this is BS and not C?
“EnTerr” wrote:
2. Can you put a feature request for this to be done? I.e. allow saving image locally in a format which is both easy to implement and roGridScreen&co will feel comfortable as poster (i seem to remember it may take PNG/GIF but will convert to JPG) - or alternatively have a way to provide TEXT as poster blot
The request is already in the system, just followed up, the more really useful use-cases for this sort of thing there are, the higher likelihood of it actually happening.
Is there any progress on this, RokuJoel?
I find myself today wanting to show non-prerendered/app-generated posters in roGridScreen and with no way for that.
Something must have happened during those two years; any notes, updates - even if it were deemed “ain’t gonna happen”, that’s helpful to know too.