UI screen space viewport
Posted: 13 Nov 2019, 09:53
Is there a API to get screen space viewport information of any UIElement?
From the following post
viewtopic.php?f=3&t=1542&p=8842&hilit=s ... +box#p8842
I know UIElement.PointToScreen() can calculate screen space coordinate.
So maybe I can compute screen viewport as
Is this viable? or is there already existed some API to do this?
From the following post
viewtopic.php?f=3&t=1542&p=8842&hilit=s ... +box#p8842
I know UIElement.PointToScreen() can calculate screen space coordinate.
So maybe I can compute screen viewport as
Code: Select all
var begin = uielement.PointToScreen(new Point(0, 0));
var end = uielement.PointToScreen(new Point(uielement.width, uielement.height));
Rect viewport = new Rect(begin.x, begin.y, end.x - begin.x, end.y - begin.y);