Anyone know a good way to load a gif from a byte stream?

Im looking to create a dll that can take a GIF, render it and return it as a picture object. (return the dc)