I was wondering how to do this, too. Then I noticed Universal Updater loads images over the network so I was able to find an example. I can't post the link, but look at the implementation of Screenshot::ConvertFromBuffer() in source/utils/screenshot.cpp.