namespace Tickypip { using System.Collections; using Gdk; public class ImageLoader { private static Hashtable mPixbufs = new Hashtable(); public static Pixbuf Load(string name, int width, int height) { Pixbuf pixbuf; if (mPixbufs.ContainsKey(name)) { pixbuf = mPixbufs[name] as Pixbuf; if (pixbuf.Width == width && pixbuf.Height == height) return pixbuf; pixbuf.Dispose(); } pixbuf = Rsvg.Pixbuf.FromFileAtSize(Defines.DATADIR + "/tickypip/pixmaps/" + name, width, height); mPixbufs[name] = pixbuf; return pixbuf; } } }