Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 

How can we achieve a transparent background in image canvas

Hi All,

Is there a way we can achieve transparent background in image canvas using opacity or something like that when we draw a rectangle.

Regards,
Prajwal
0 Kudos
3 Replies
EnTerr
Level 8

Re: How can we achieve a transparent background in image can

This is hopelessly undocumented - but i will take a guess you can use color attribute for the rectangle?
If so, it is likely RGBA and by varying the Alpha channel between 0 and 255 you can get levels of transparency.
0 Kudos
TheEndless
Level 7

Re: How can we achieve a transparent background in image can

"EnTerr" wrote:
This is hopelessly undocumented - but i will take a guess you can use color attribute for the rectangle?
If so, it is likely RGBA and by varying the Alpha channel between 0 and 255 you can get levels of transparency.

roImageCanvas colors are actually ARGB, but you are correct. Set the color to an ARGB value and set the CompositionMode to "Source_Over" and that will alpha blend the TargetRect over the underlying layers.
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
EnTerr
Level 8

Re: How can we achieve a transparent background in image can

"EnTerr" wrote:
This is hopelessly undocumented -

Documented 7/31 - thanks, RokuKC!
0 Kudos