Пример #1
0
        private Rect ToRect(int w, int h, FocusPointDefinition definition, double dw, double dh)
        {
            switch (definition.FocusPointType)
            {
            case FocusPointType.Square:
                return(new Rect(w * definition.XRat - (150 * dw), h * definition.YRat - (100 * dh), 300 * dw, 200 * dh));

            case FocusPointType.VRectangle:
                return(new Rect(w * definition.XRat - (150 * dw), h * definition.YRat - (50 * dh), 300 * dw, 100 * dh));

            case FocusPointType.HRectangle:
                return(new Rect(w * definition.XRat - (50 * dw), h * definition.YRat - (150 * dh), 100 * dw, 300 * dh));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #2
0
 private Rect ToRect(int w, int h, FocusPointDefinition definition, double dw, double dh)
 {
     switch (definition.FocusPointType)
     {
         case FocusPointType.Square:
             return new Rect(w*definition.XRat - (150*dw), h*definition.YRat - (100*dh), 300*dw, 200*dh);
         case FocusPointType.VRectangle:
             return new Rect(w*definition.XRat - (150*dw), h*definition.YRat - (50*dh), 300*dw, 100*dh);
         case FocusPointType.HRectangle:
             return new Rect(w*definition.XRat - (50*dw), h*definition.YRat - (150*dh), 100*dw, 300*dh);
         default:
             throw new ArgumentOutOfRangeException();
     }
 }