コード例 #1
0
        public static IHtmlString Picture(this HtmlHelper helper, UrlBuilder imageUrl, ImageType imageType, string cssClass = "", LazyLoadType lazyLoadType = LazyLoadType.None, string altText = "")
        {
            if (imageUrl == null)
            {
                return(new MvcHtmlString(string.Empty));
            }

            var pictureData    = PictureUtils.GetPictureData(imageUrl, imageType, lazyLoadType == LazyLoadType.Progressive, altText);
            var pictureElement = BuildPictureElement(pictureData, cssClass, lazyLoadType);

            return(new MvcHtmlString(HttpUtility.HtmlDecode(pictureElement)));
        }