static Transform WrapDpiTransform(Transform origTransform, double dpiScaleFactor) { var group = new TransformGroup(); if (origTransform != null) { group.Children.Add(origTransform); } group.Children.Add(new ScaleTransform(dpiScaleFactor, dpiScaleFactor)); UIHooks.SetIsDpiTransform(group, true); return(group); }