Developers

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
Tags (1)
0 Kudos
3 REPLIES 3
RokuJoel
Binge Watcher

Re: roCompositor is clipping images and biasing incorrectly

What Roku Firmware version do you have?

- Joel
Tags (1)
0 Kudos
bitninja
Visitor

Re: roCompositor is clipping images and biasing incorrectly

I am running 4.9.build5060
Tags (1)
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
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!

For support, visit support.roku.com.