deviceInfo = CreateObject("roDeviceInfo")
uiResolution = deviceInfo.GetUIResolution()
displaySize = deviceInfo.GetDisplaySize()
Width = displaySize.w
Height = displaySize.h
<Component: roAssociativeArray> =
{
h: 1080
w: 1920
}
keypadPos = { x: int(.1*width), y: int(.287*Height), w: int(.23*width), h: int(.52*Height)}
this.canvas.SetLayer(3, { url: "pkg:/locale/default/images/KB/login/$abc3.png", TargetRect: keypadPos }
------ Running dev 'Display Modes Dump' main ------
----- roDeviceInfo -----
GetDisplayType = HDTV
GetDisplayMode = 1080p
GetDisplayAspectRatio = 16x9
GetDisplaySize =
{
GetDisplaySize: w = 1920
GetDisplaySize: h = 1080
}
GetDisplayProperties =
{
GetDisplayProperties: width = 41
GetDisplayProperties: height = 23
GetDisplayProperties: Hdr10 = false
GetDisplayProperties: DolbyVision = false
GetDisplayProperties: internal = false
}
GetSupportedGraphicsResolutions =
[
{
GetSupportedGraphicsResolutions: width = 1280
GetSupportedGraphicsResolutions: name = HD
GetSupportedGraphicsResolutions: preferred = false
GetSupportedGraphicsResolutions: height = 720
GetSupportedGraphicsResolutions: ui = false
}
{
GetSupportedGraphicsResolutions: width = 1920
GetSupportedGraphicsResolutions: name = FHD
GetSupportedGraphicsResolutions: preferred = true
GetSupportedGraphicsResolutions: height = 1080
GetSupportedGraphicsResolutions: ui = true
}
]
GetVideoMode = 1080p
GetCanvasRect =
{
GetCanvasRect: w = 1280
GetCanvasRect: x = 0
GetCanvasRect: y = 0
GetCanvasRect: h = 720
}
GetUIResolution =
{
GetUIResolution: width = 1920
GetUIResolution: name = FHD
GetUIResolution: height = 1080
}
------------------------
"RENJITHVR4" wrote:
Hi, Thank you very much for your reply with your solution. I appreciate that. So we should hard-code the width and height like 1920:1080 or 1280:720 . right?
Actually, we are taking the position with respect to the current resolution via displaySize = deviceInfo.GetDisplaySize(). But this is not working here. should I hard-code height and width?
"Veeta" wrote:
Best thing to do is to use the width and height from GetCanvasRect() to calculate positions rather than GetDisplaySize().