private void ResizeU3D() { if (isU3DLoaded) { Window window = Window.GetWindow(this); u3dLeftUpPos = Panel1.TransformToAncestor(window).Transform(new Point(0, 0)); DPIUtils.Init(this); //MessageBox.Show($"{DPIUtils.DPIX},{DPIUtils.DPIY}"); u3dLeftUpPos.X *= DPIUtils.DPIX; u3dLeftUpPos.Y *= DPIUtils.DPIY; MoveWindow(unityHWND, (int)u3dLeftUpPos.X, (int)u3dLeftUpPos.Y, (int)(Panel1.ActualWidth * DPIUtils.DPIX), (int)(Panel1.ActualHeight * DPIUtils.DPIY), true); ActivateUnityWindow(); } }