PdfRpt.ColumnsItemsTemplates.ImageFilePathField.getImage C# (CSharp) Method

getImage() private method

private getImage ( PdfRpt.Core.Contracts.CellAttributes attributes ) : Image
attributes PdfRpt.Core.Contracts.CellAttributes
return Image
        private Image getImage(CellAttributes attributes)
        {
            var path = FuncHelper.ApplyFormula(attributes.BasicProperties.DisplayFormatFormula, attributes.RowData.Value);
            attributes.RowData.FormattedValue = path;
            if (!string.IsNullOrEmpty(path) && File.Exists(path))
            {
                return path.GetITextSharpImageFromImageFile(_cacheImages);
            }

            if (!string.IsNullOrEmpty(_defaultImageFilePath) && File.Exists(_defaultImageFilePath))
            {
                return _defaultImageFilePath.GetITextSharpImageFromImageFile(this._cacheImages);
            }
            throw new FileNotFoundException(string.Format(CultureInfo.InvariantCulture, "{0} does not exists & defaultImageFilePath was not found.", path));
        }