public JsonNetResult CropAvatar(int width, int height, int x, int y)
        {
            var bytes        = GlobalUtilities.GetExternalImageBytes(GlobalUtilities.GetUncroppedCustomerAvatarUrl(Identity.Current.CustomerID));
            var croppedBytes = GlobalUtilities.Crop(bytes, width, height, x, y);

            Exigo.Images().SetCustomerAvatar(Identity.Current.CustomerID, croppedBytes, true);

            return(new JsonNetResult(new
            {
                success = true
            }));
        }
Пример #2
0
        public JsonNetResult CropAvatar(int width, int height, int x, int y, string rawBytes)
        {
            var bytes = Convert.FromBase64String(rawBytes);

            var croppedBytes = GlobalUtilities.Crop(bytes, width, height, x, y);

            Exigo.Images().SetCustomerAvatar(Identity.Current.CustomerID, croppedBytes, true);


            return(new JsonNetResult(new
            {
                success = true
            }));
        }