
TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2011
01:11 PM
[SDK Bug : 3.0 : Reproducible] roRegion from roRegion
I've discovered a bug in the 3.0 SDK that causes the box to crash and reboot...
If you create an roRegion component from another roRegion component, then call DrawObject on the new roRegion, the box will crash and reboot. This is obviously simplified to illustrate the issue, but the following code will reproduce the issue:
The workaround (correct way to do this?) is to create the second region using the GetBitmap() method of the first region:
If you create an roRegion component from another roRegion component, then call DrawObject on the new roRegion, the box will crash and reboot. This is obviously simplified to illustrate the issue, but the following code will reproduce the issue:
screen = CreateObject("roScreen")
' Create a 100x100 white square bitmap
bitmap = CreateObject("roBitmap", { Width:100, Height: 100, AlphaEnable: False })
bitmap.Clear(&HFFFFFFFF)
' Create a region for the bitmap
region = CreateObject("roRegion", bitmap, 0, 0, bitmap.GetWidth(), bitmap.GetHeight())
' Create a second region from the previous region. This should probably fail, but does not.
region2 = CreateObject("roRegion", region, 0, 0, region.GetWidth(), region.GetHeight())
' This line will crash the box
screen.DrawObject(0, 0, region2)
The workaround (correct way to do this?) is to create the second region using the GetBitmap() method of the first region:
' Create a second region from the previous region's bitmap.
region2 = CreateObject("roRegion", region.GetBitmap(), 0, 0, region.GetWidth(), region.GetHeight())
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)