Here's a tip when using images with GDI+.
GDI+ Bitmaps and GDI+ Images are interchangeable so if you want to save a HBITMAP to disk as a JPG use something like the following.
(EDIT: By Bitmaps and Images are interchangeable I should qualify that. Interchangeable for API's I have tried.)
Use GpBitmap_FromHBITMAP(HBITMAP hbm, HPALETTE hpal) to convert your HBITMAP to a GDI+ Bitmap then use one of the routines linked to above on my web site. Parameter hpal is NULL for a Device Independent bitmap.
http://www.johnfindlay.plus.com/pellesc/GdiPlus/GdiPlus.htmYou will need to cast the GDI+ Bitmap to GDI+ Image
(GP_IMAGE*)
John