8

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)

STLDev
  • 5,950
  • 25
  • 36
Shekhar_Pro
  • 18,056
  • 9
  • 55
  • 79

1 Answers1

12

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

alexn
  • 57,867
  • 14
  • 111
  • 145
  • Obviously gravatar generates hash based on email. – zerkms Dec 22 '10 at 13:42
  • Yep, i know. Did not know StackOverflow used gravatar for the Identicons. – alexn Dec 22 '10 at 13:43
  • 3
    http://www.gravatar.com/avatar/a63e9bcbecb716d9be2031db853229bd?s=32&d=identicon&r=PG - why did not you just look at the OPs identicon image src? ;-) – zerkms Dec 22 '10 at 13:44