Esempio n. 1
0
        public override Node Generate(Context context)
        {
            if (ImageCache == null)
            {
                GenerateResources(SourcePath, ref ImageCache);
            }

            var biggestMip = ImageCache.Mips.First();
            var uri        = ImageCache.GetFileUri(biggestMip.Value);

            var result = new VoidTag("img")
                         .Attribute("src", uri.ToString());

            if (ImageCache.Roi != null)
            {
                result = new Tag("div")
                         .Attribute("style", $"overflow: hidden; background-color: {BackgroundColor()};")
                         //.Attribute("style", $"background-color: {BackgroundColor()};")
                         .Add(result)
                         //.Attribute("style", $"background-color: {BackgroundColor()};")
                         .Add(new Behaviour("RoiImage", ImageCache.Aspect, ImageCache.Roi).Generate(context));
            }
            else if (!ImageCache.IsVectorImage)
            {
                result.Attribute("style", $"max-width: {biggestMip.Key}px;");
            }

            result.AddClasses("Image");

            return(result);
        }
Esempio n. 2
0
            public void Br()
            {
                var node = new VoidTag("br");

                Add(node);
            }