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: 

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 3
EnTerr
Roku Guru

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
Channel Surfer

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

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

"EnTerr" wrote:
This is hopelessly undocumented -

Documented 7/31 - thanks, RokuKC!
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.