Simon_Weaver
Simon_Weaver

Reputation: 145950

Realtime creation of csssprites in .NET

Has anyone created a 'realtime' csssprite generator for .NET ?

I want one or more directories of images that get loaded at runtime and the css is automatically generated.

Upvotes: 1

Views: 554

Answers (3)

Matt Perdeck
Matt Perdeck

Reputation: 21

Yes, there is. You'll find it at http://www.codeproject.com/KB/aspnet/cssspritegenerator.aspx

Unlike Microsoft's attempt at sprites, with this package you don't have to change the way your images are stored and how they are shown. You simply add the .dll and configure the package in your web.config with a few lines.

This package also lets you resize images on the fly, compress them and other good things.

Upvotes: 2

Simon_Weaver
Simon_Weaver

Reputation: 145950

Ok finally something official...

Not clear yet if it'll make it into the core ASP.NET framework but here's a Microsoft codeplex project for csssprites :

http://aspnet.codeplex.com/releases/view/50869

if you like it - use it - or just like the idea then add a comment. I think this would be a great thing to have in the ASP.NET framework. Have not personally used it (I had to invent the wheel myself) but its got good reviews.


It includes the following components:

  • API for automatically generating sprites and inline images
  • Controls and helpers which provide a convenient way of calling into the API

Features Added in Second Release:

  • A CSS linking control for Web Forms (selects the proper CSS file for the user's browser, but does not display an image)
  • Using custom folder paths other than App_Sprites
  • Changing the tiling direction of sprite images
  • Merging the generated CSS with a user's own CSS

Features under consideration for future releases:

  • Automatically selecting the most efficient sprite background colour
  • Automatically minifying the rendered CSS
  • Compiling against .NET 3.5

Upvotes: 0

Esteban Küber
Esteban Küber

Reputation: 36832

Is this what you are looking for? It's the closest I found to a baked solution.

Upvotes: 1

Related Questions