Esempio n. 1
0
        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));
            DpiEvents.SetIsDpiTransform(group, true);
            return(group);
        }
Esempio n. 2
0
 static Transform UnwrapDpiTransform(Transform currentTransform)
 {
     if (currentTransform != null && DpiEvents.GetIsDpiTransform(currentTransform))
     {
         var group = currentTransform as TransformGroup;
         if (group != null && group.Children.Count > 1)
         {
             return(group.Children[0]);
         }
         return(null);
     }
     return(currentTransform);
 }