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

How to reduce Opacity of image in roScreen

Is there any method to reduce Opacity of image in roku sdk. please help me to find out reduce Opacity of image in roScreen.
0 Kudos
6 REPLIES 6
TheEndless
Channel Surfer

Re: How to reduce Opacity of image in roScreen

The DrawObject() method has an undocumented fourth parameter for alpha. Integer value from &HFFFFFF00 to &HFFFFFFFF. DrawRotatedObject and DrawScaledObject should also have the same undocumented parameter. This is not available on the legacy 3.x firmware.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
cpjamloki
Visitor

Re: How to reduce Opacity of image in roScreen

thanx endless for reply. i am writing code as:
bm=createobject("roBitmap", images comes here randomely)
m.screen.DrawScaledObject(FIX(marginX), FIX(marginY), imageWidth / bm.GetWidth(), imageHeight / bm.GetHeight(),&HFFFFFF00, bm)

it give's me error .

As you suggest: This is not available on the legacy 3.x firmware.
i am working on roku2XD device. please tell me what is the process to check legacy 3.x firmware?
and please suggest me how to pass fourth parameter for alpha as opacity in DrawScaledObject.
Any help would be thankful to me.
0 Kudos
Komag
Roku Guru

Re: How to reduce Opacity of image in roScreen

You probably just need to switch the last two, like this:

m.screen.DrawScaledObject(FIX(marginX), FIX(marginY), imageWidth / bm.GetWidth(), imageHeight / bm.GetHeight(), bm, &HFFFFFF00)

To check legacy firmware you could check the model number and compare against a list of classic Rokus stuck with 3.1:
http://sdkdocs.roku.com/display/sdkdoc/ ... ssicModels
0 Kudos
cpjamloki
Visitor

Re: How to reduce Opacity of image in roScreen

how to convert integer value to hexa code. i mean i want to give opacity 0.5 so which color i should pass?
according to "Integer value from &HFFFFFF00 to &HFFFFFFFF". and would Roku2 XD support this?
0 Kudos
cpjamloki
Visitor

Re: How to reduce Opacity of image in roScreen

Thanx Komag for gr8 reply. it's working.
0 Kudos
Komag
Roku Guru

Re: How to reduce Opacity of image in roScreen

it's two digits from 0 to F, 16 each, so with two that makes 256
00 through 0F is basically 1-16 (really 0-15)
So 0.5 that you want is 128, which is 7F or 80 depending how you count
0 Kudos