That is the process that Windows actually uses for using a JPG image on the Desktop. It has a bitmap copy of the JPG file.

I did not document it myself but did track down how it actually operates a long time ago. I'm sure if you search enough you'll find the Microsoft documentation that explains the "path" of how it's done.