Is there any easy way to write JPEG files from a DIB? I have an array of bytes representing an RGB image and the corresponding BITMAPINFO structure. How could I open a file to store this image as a JPEG?

Thanks a bunch!