예제 #1
0
        public ImageResult DefineSizeOfImage(string size, ImageResult image)
        {
            if (string.IsNullOrEmpty(size) || image == null)
            {
                return(image);
            }
            var result     = image.Clone();
            var sizeResult = size.Split('x');

            if (sizeResult.Count() <= 1 || sizeResult.Count() > 2)
            {
                return(image);
            }
            int width, height;

            int.TryParse(sizeResult[0], out width);
            int.TryParse(sizeResult[1], out height);
            result.ImageData = WebRock.Utils.FileUtils.ImageUtils.CreateIconSimple(result.ImageData, new Size(width, height));
            return(result);
        }