I use the following, where rect is { x, y, w, h }, point is { x, y }, and size is { w, h }.
Sub HDRectToSDRect(rect As Object)
wMultiplier = 720 / 1280
hMultiplier = 480 / 720
If rect.x <> invalid Then
rect.x = Int(rect.x * wMultiplier + .5)
rect.x = IIf(rect.x < 1, 1, rect.x)
End If
If rect.y <> invalid Then
rect.y = Int(rect.y * hMultiplier + .5)
rect.y = IIf(rect.y < 1, 1, rect.y)
End If
If rect.w <> invalid Then
rect.w = Int(rect.w * wMultiplier + .5)
rect.w = IIf(rect.w < 1, 1, rect.w)
End If
If rect.h <> invalid Then
rect.h = Int(rect.h * hMultiplier + .5)
rect.h = IIf(rect.h < 1, 1, rect.h)
End If
End Sub
Sub HDPointToSDPoint(point As Object)
HDRectToSDRect(point)
End Sub
Sub HDSizeToSDSize(size As Object)
HDRectToSDRect(size)
End Sub
Function IIf(Condition, Result1, Result2) As Dynamic
If Condition Then
Return Result1
Else
Return Result2
End If
End Function
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)