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

roCompositor is clipping images and biasing incorrectly

For the following code I am seeing two problems. The first is that all images are off 18pixels higher than they should be and 32 pixels to the left of where expected. In addition large images (greater than 1000 width) are clipped right around the ~1050 pixel area (pixel cutoff width on screen not of image). Weird thing is when I place multiple images only larger images are clipped past the 1050 pixel region. If I have a image that is around 200Wx150H I can place these anywhere within the view without clipping. However all images are subject to the strange 18w32h pixel offset. I get the problem even running the following modified from the rocompositor example code.

Function main()
black=&hFF'RGBA
screen=CreateObject("roScreen")
compositor=CreateObject("roCompositor")
compositor.SetDrawTo(screen, black)
bigbm=CreateObject("roBitmap","pkg:/images/image_old_hd.png") 'Image is 1000wx350H
region=CreateObject("roRegion", bigbm, 0, 0, 850, 720)
view_sprite=compositor.NewSprite(200, 200, region)
compositor.draw()
msgport = CreateObject("roMessagePort")
screen.SetMessagePort(msgport)
codes = bslUniversalControlEventCodes()
While True
msg=wait(0, msgport) ' wait for a button
If type(msg)="roUniversalControlEvent" Then
If msg.GetInt() = codes.BUTTON_BACK_PRESSED ' back button
Exit While
End If
End If
End While
End Function
0 Kudos
3 REPLIES 3
RokuJoel
Binge Watcher

Re: roCompositor is clipping images and biasing incorrectly

What Roku Firmware version do you have?

- Joel
0 Kudos
bitninja
Visitor

Re: roCompositor is clipping images and biasing incorrectly

I am running 4.9.build5060
0 Kudos
RokuJoel
Binge Watcher

Re: roCompositor is clipping images and biasing incorrectly

There are many things wrong with the code you posted above, the primary issue being it doesn't work.

* if the image is 1000 x 350 then you can't create a region that is 850 x 720
* there is no screen.finish() in your code
* try compositor.drawall()
* since the region is invalid, you won't be able to create a sprite.

I suggest posting some tested code that actually works along with a link to the graphics in question, or, better yet, upload a zip file for testing and post a link to it.

Also, in the future please use the code tag around any code you post.

- Joel
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.