PxWriteImage & PX_IMAGE_JPG

I would like to save PhImage_t image as jpg file. There is no
documenation of the PxWriteImage function. However I found an example on
http://www.qnx.com/developers/articles/article_293_2.html but I am not
able to save it in any other format than BMP. Could you send me a short
example how to do it?

Thank you,