Windows.Foundation.Rect win_rect = Windows.UI.Xaml.Window.Current.CoreWindow.Bounds;
screen = screen.Offset(-win_rect.X, -win_rect.Y);
- var gt = element.TransformToVisual(element);
+ var gt = Windows.UI.Xaml.Window.Current.Content.TransformToVisual(element);
return gt.TransformPoint(screen);
}
public static Point GetScreentPoint(Point client, Windows.UI.Xaml.UIElement element)
{
//ウィンドウ内での絶対座標を取得する
- var gt = element.TransformToVisual(element);
- Point screenPoint = gt.TransformPoint(client);
+ Point screenPoint = GetPointInWindow(client, element);
//Windows10以降では補正する必要がある
Windows.Foundation.Rect win_rect = Windows.UI.Xaml.Window.Current.CoreWindow.Bounds;
screen.X -= win_rect.X;
screen.Y -= win_rect.Y;
- var gt = element.TransformToVisual(element);
+ var gt = Windows.UI.Xaml.Window.Current.Content.TransformToVisual(element);
return gt.TransformBounds(screen);
}
public static Windows.Foundation.Rect GetScreentRect(Windows.Foundation.Rect client, Windows.UI.Xaml.UIElement element)
{
//ウィンドウ内での絶対座標を取得する
- var gt = element.TransformToVisual(element);
+ var gt = element.TransformToVisual(null);
Windows.Foundation.Rect screenRect = gt.TransformBounds(client);
//Windows10以降では補正する必要がある