Skip to content
CustomerFX edited this page Sep 13, 2010 · 2 revisions

This repository contains a utility library for retrieving and caching gravatar images from e-mail addresses.

Caching is only recommended in a Windows application environment. If used from a web environment you can disable caching.

Usage

Synchronously retrieving a gravatar image (80×80 pixels)

Gravatar gravatar = new Gravatar("email@email.com", 80);
gravatar.GetImage();

pictureBox1.Image = gravatar.Image;

Asynchronously retrieving a gravatar image (80×80 pixels)

Gravatar gravatar;

private void GetGravatarImage()
{
    gravatar = new Gravatar("email@email.com", 80);
    gravatar.AsyncImageRetrieved += new EventHandler(this.GravatarReceived);
    gravatar.GetImageAsync();
}

private void GravatarReceived(object sender, EventArgs e)
{
    pictureBox1.Image = gravatar.Image;
}

Synchronously retrieving a gravatar image (80×80 pixels) without using the cache

Gravatar gravatar = new Gravatar("email@email.com", 80);
gravatar.DisableCache = true;
gravatar.GetImage();

pictureBox1.Image = gravatar.Image;

Clone this wiki locally