Hi Ramesh,
Thank you for sending gradtest.zip.
If I am not wrong, The function in prg uses the external EXE files. BMPtoJPG and NCONVERT.
Can you also provide these files if it is possible?. I try find them from net. but i think different versions can not works like your function wanted.