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: 

Roku PNG decoding

Hello Developers,

I am currently working on an application for Roku that needs to display PNG images using the RoScreen object. (code added below).

I am encoding a 1280*720 image by the png specification (outside of Roku) according to the PNG form but I still can not see the images displayed on Roku devices while it is showing on win 10, Unity, browsers, paint and more... 

My question are:

  • Are there any specific requirements from a png image to be displayed in this manner in Roku? 
  • Is there a difference between Roku PNG decoder (on Roku devices) and any other standard PNG decoder in the industry?
  • Could you tell what needs to be done to be compatible to Roku standards?

Code:

m.tmpfilename = "tmp:/srn.png"
    m.screen=CreateObject("roScreen", true, 1280, 720) 
    m.msgport = CreateObject("roMessagePort")
    m.screen.SetPort(m.msgport)

    m.fullUdpPic.writefile(m.tmpfilename)     
  m.newPNG=CreateObject("roBitmap",m.tmpfilename)
    m.screen.drawobject(0, 0,m.newPNG)
    m.screen.SwapBuffers()

link to the PNG - PNG 

Any insight would be appreciated. 

Thank you!

0 Kudos
1 REPLY 1
renojim
Community Streaming Expert

Re: Roku PNG decoding

How are you getting the PNG into tmp:/srn.png?  Have you verified that it's stored properly?  Print m.newPNG.

print m.newPNG

Does it print "invalid"?  There's stuff in your code that is irrelevant.  What is "m.fullUdpPic"?

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
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.