GDI+ provides a Image class, and you can use this class to read a image file with one format and then save this file to another format. But if I want to just decode a jpeg file (already loaded into memory), how can I do it?
You can use
IStream* stream = SHCreateMemStream(buf, bufsize); Gdiplus::Image *image = Gdiplus::Image::FromStream(stream); Gdiplus::Graphics g(hdc); g.DrawImage(image,0,0);
buf contains jpeg data (or any other compatible image format) and
bufsize is the length of that data.