Exemplo n.º 1
0
 public virtual Sprite Add(BackgroundImageClass image)
 {
     var imageKey = new ImageMetadata(image);
     if (spriteList.ContainsKey(imageKey))
         return spriteList[imageKey];
     var currentPositionToReturn = SpriteContainer.Width;
     SpriteContainer.AddImage(image);
     var sprite = new Sprite(currentPositionToReturn, spriteIndex);
     if (SpriteContainer.Size >= config.SpriteSizeLimit)
         Flush();
     spriteList.Add(imageKey, sprite);
     return sprite;
 }
Exemplo n.º 2
0
 public string InjectSprite(string originalCss, BackgroundImageClass image, Sprite sprite)
 {
     return originalCss.Replace(image.OriginalClassString, image.Render(sprite));
 }