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

Drawing entire screen to bitmap - bug?

Hi, I am just a little curious why this code works on my Roku 1 but not on my Roku 3?


bm_fuzzy_background = CreateObject("roBitmap", {width: 854, height: 480, AlphaEnable: True})
bm_fuzzy_background.DrawObject(0, 0, m.screen)
bm_fuzzy_background.DrawObject(3, 0, m.screen, &HFFFFFF80)
bm_fuzzy_background.DrawObject(-3, 0, m.screen, &HFFFFFF80)
bm_fuzzy_background.DrawRect(0, 0, 854, 480, &h00000080)


It's basically a quick way of freezing the background, making it fuzzy, and the darkening it while you draw something else above it.

Let me know if you have any thoughts, much appreciated.

Romans I XVI
0 Kudos
9 REPLIES 9
NewManLiving
Visitor

Re: Drawing entire screen to bitmap - bug?

Considering that roScreen implements the 2d interface you would think it would act similar to a bitmap. May have something to do with the devices support for open gl. Can't say for sure . If I recall correctly even if you create a region on the screen you can write to it and it clips properly but if you try to copy that region to a bitmap you get some kind of distorted monster. Would be nice if you could create your own screencopy consistently. After all the screenshot utility has no problem providing one.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
Romans_I_XVI
Roku Guru

Re: Drawing entire screen to bitmap - bug?

Yeah, that's what I was thinking too, something to do with the openGL. It's the only difference I can think of that would affect this.

It's sort of frustrating, I was so happy with how great it worked on my Roku 1. Then Roku 3 just gives me a black screen. :?
0 Kudos
Komag
Roku Guru

Re: Drawing entire screen to bitmap - bug?

- Could it have something to do with the resolution? Roku 3 only outputs HD, whereas Roku 1 does both HD and SD.
- Could your exact firmware versions be different, one box is more updated than the other?
- The AlphaEnable is probably the culprit though, as I've read that different models of Rokus throughout history handle that differently, and it may be more than just openGL differences.
- It's possible you'll have better luck with different arcane combinations of Region, Bitmap, and Screen.
0 Kudos
EnTerr
Roku Guru

Re: Drawing entire screen to bitmap - bug?

Troubleshoot it by simplifying. You are still doing too many things in the example, try to narrow it down.
For example, can you copy the roScreen to a separate roBitmap and then do the dim/blurring with that?
Try to track at which step does it break and not behave as expected.
0 Kudos
Romans_I_XVI
Roku Guru

Re: Drawing entire screen to bitmap - bug?

I just posted the whole thing so you could see what I'm doing, but it fails with any attempt to draw roScreen to a bitmap.

Thanks for the tip but yeah, any attempt to draw roScreen to a bitmap results in a blank bitmap on my Roku 3. Works fine on my Roku 1. ¯\(°_°)/¯
0 Kudos
EnTerr
Roku Guru

Re: Drawing entire screen to bitmap - bug?

Great, let's keep troubleshooting
- does it have to do something with the setting of AlphaEnable?
- does it have something to do with the size of the screen and of the bitmap (e.g. what if we change screen resolution in Settings or in createObject; or maybe the bitmap is "too small"; maybe it just ignores copy requests from bigger to smaller bitmap?)
0 Kudos
Romans_I_XVI
Roku Guru

Re: Drawing entire screen to bitmap - bug?

Lol, think you share the same train of thought as me.

Tried both alpha settings and different sizes. No luck.

P.S. I've already settled with a suitable alternative so I don't really mind if it doesn't work. At this point the thread is more informational for other users.
0 Kudos
RokuJoel
Binge Watcher

Re: Drawing entire screen to bitmap - bug?

Have you tried creating a Region from the roScreen and the bitmapt and using that to draw to your bitmap's region instead of drawing from the Screen to the bitmap directly?

- Joel
0 Kudos
Romans_I_XVI
Roku Guru

Re: Drawing entire screen to bitmap - bug?

Also not sure if this matters. I'm using dfSetupDisplayRegions() . Neither my main region that I'm drawing everything to nor my roScreen component will draw to a bitmap.

I can try to take a section and attempt to draw that region to a bitmap and see what happens.
0 Kudos