private static float GetVerticalScaleFactor(Size imageSize, Size maxImageSize)
        {
            float result = 1f;

            if (UserPhotoUtilities.NeedsVerticalCrop(imageSize, maxImageSize))
            {
                result = (float)maxImageSize.Height / (float)imageSize.Height;
            }
            return(result);
        }
        private static PointF GetImageCenterPosition(Size imageSize, Size maxImageSize)
        {
            PointF result = new PointF(0f, 0f);

            if (UserPhotoUtilities.NeedsHorizontalCrop(imageSize, maxImageSize))
            {
                result.X = (float)(imageSize.Width - maxImageSize.Width) * 0.5f;
            }
            if (UserPhotoUtilities.NeedsVerticalCrop(imageSize, maxImageSize))
            {
                result.Y = (float)(imageSize.Height - maxImageSize.Height) * 0.35f;
            }
            return(result);
        }