"TheEndless" wrote:
It's an RGBA value in the range of &HFFFFFF00 to &HFFFFFFFF. No idea what the RGB portion is for. This has no effect on the destination AlphaEnable state. It should behave the same as it would if you were drawing an image that was already semi-transparent (i.e., blend pixels if AlphaEnable is true, replace pixels if AlphaEnable is false).
"squirreltown" wrote:
I don't think color tinting a bitmap works if i read you right, the Roku seems to ignore the color part of the hex string if its a bitmap - if you set a bitmap color to &hFFFFFFFF or &h000000FF it looks the same.
bitmap = CreateObject("roBitmap", {width: 100, height: 100})
bitmap.Clear(&hFFFFFFFF)
screen = CreateObject("roScreen")
for i = 0 to 255
screen.DrawObject(50 + 512-2*i, 50 + 0, bitmap, RGBA(255, 255-i, 0, 255))
screen.DrawObject(50 + 0, 50 + 512-2*i, bitmap, RGBA(i, 0, 0, 255))
screen.DrawObject(50 + 2*i, 50 + 512, bitmap, RGBA(0, i, 0, 255))
screen.DrawObject(50 + 512, 50 +2*i, bitmap, RGBA(255-i, 255, 0, 255))
'screen.finish()
end for
screen.finish()
wait(0, screen.getPort())
function RGBA(r, g, b, a)
return &h1000000*r + &h10000*g + &h100*b + a
end function
"EnTerr" wrote:
PS. bonus points if someone can explain why this code works always on Roku3 (4200) - but same code on HDMI stick (3500) shows the roScreen in only about 40-50% of the time, rest of the cases channel stays in "Loading..." screen forever (=till exiting manually). Seems like a nasty race condition bug.
"TheEndless" wrote:"EnTerr" wrote:
PS. bonus points if someone can explain why this code works always on Roku3 (4200) - but same code on HDMI stick (3500) shows the roScreen in only about 40-50% of the time, rest of the cases channel stays in "Loading..." screen forever (=till exiting manually). Seems like a nasty race condition bug.
Assuming you've pasted that code directly into Main/RunUserInterface, it's likely because you don't have a facade open to keep the channel alive, and the call to CreateObject("roBitmap") is right on the edge of the threshold. Move the CreateObject("roScreen") before the creation of the bitmap, and I bet it runs 100% of the time.
"EnTerr" wrote:"TheEndless" wrote:"EnTerr" wrote:
PS. bonus points if someone can explain why this code works always on Roku3 (4200) - but same code on HDMI stick (3500) shows the roScreen in only about 40-50% of the time, rest of the cases channel stays in "Loading..." screen forever (=till exiting manually). Seems like a nasty race condition bug.
Assuming you've pasted that code directly into Main/RunUserInterface, it's likely because you don't have a facade open to keep the channel alive, and the call to CreateObject("roBitmap") is right on the edge of the threshold. Move the CreateObject("roScreen") before the creation of the bitmap, and I bet it runs 100% of the time.
Yes, code is straight from Main.
Nope, moving roScreen creation on top does not change the situation, still 5 out of 10 runs no good; no regular patern (i.e. not every other time).
"Facade" use was prescribed to avoid channel exiting prematurely - but this is not the case here, it stays in "wait", i can ctrl-C that in console and code gets interrupted. Then the usual YMMV "sudden death syndrome" may happen (i.e. Roku exit to main menu) but if it stays - i can issue commands like screen.finish()/swapbuffers() but the "Loading..." screen stays.
Zie Stick is on 5.4.2525...
"squirreltown" wrote:
Thats cool. I should have said external (.png .jpg) bitmaps.
[/spoiler:4ytc4snt]
screen = CreateObject("roScreen")
screen.Clear(&h715883ff)
screen.setAlphaEnable(true)
xfer = createObject("roUrlTransfer")
xfer.setUrl("http://www.roku.com/sites/all/themes/roku/images/logo.png")
? "get to file", xfer.getToFile("tmp:/logo.png")
bitmap = CreateObject("roBitmap", "tmp:/logo.png")
screen.drawObject(300, 300, bitmap)
screen.drawObject(50, 50+512, bitmap, &hFF)
for i = 15 to 255 step 24
screen.drawObject(50 + 0, 50 + 512-2*i, bitmap, RGBA(i, 0, 0, 255))
screen.drawObject(50 + 2*i, 50 + 512, bitmap, RGBA(0, 0, i, 255))
end for
for i = 15 to 255 step 24
screen.drawObject(50 + 2*i, 50 + 0, bitmap, RGBA(255, 0, i, 255))
screen.drawObject(50 + 512, 50 +512-2*i, bitmap, RGBA(i, 0, 255, 255))
end for
screen.finish()
wait(0, screen.getPort())