Search code examples
c#.netasp.netgravatar

Stack Overflow Userpic generation (Identicons)


i an creating a website in C# ASP.NEt and want to use a feature similar to Stack Overflow, Every time a new user registers on the StackOverflow.com he is assigned a default user picture until he has a gravatar, Now every picture is different from the previous one, so it is sure it is generated, i want to know how can this be done in C#.

Note: (I don't think it is a meta question so please don't move it there)


Solution

  • It's called Identicions. They are images generated by some kind of hash, usually on a username or email.

    There is a nice, open source library, on Codeplex for generating Identicons. More info here.

    Edit: You can actually use gravatar to generate Identicons. Construct a URL like this:

    http://www.gravatar.com/avatar/HASH_HERE?s=128&d=identicon&r=PG