Blog.Common.Utils.Helpers.ImageHelper.SaveImage C# (CSharp) Method

SaveImage() public method

public SaveImage ( Image image, string destinationPath, string fileName ) : bool
image Image
destinationPath string
fileName string
return bool
        public bool SaveImage(Image image, string destinationPath, string fileName)
        {
            try
            {
                if (!Directory.Exists(destinationPath.TrimEnd('\\')))
                {
                    FileHelper.CreateDirectory(destinationPath);
                }
                image.Save(string.Format("{0}{1}{2}", destinationPath.TrimEnd('\\'), "\\", fileName));

                return true;
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
        }

Same methods

ImageHelper::SaveImage ( byte bytes, string destinationPath, string fileName ) : bool