Render JPG into RTF via C API

Does any one know how to render JPG image into RTF field via C API?

What I need to do is:

  1. I use gd library to create JPG image (some kinds of charts);

  2. I want to store this image in a Notes document, but not as an attachment;

  3. Mail it to the users, then when they open the Note, they can read the image directly in a RFT body field.

Is it possible?

Subject: render JPG into RTF via C API

this method works :

http://www-10.lotus.com/ldd/46dom.nsf/8fcda5a283f280b2852565590071d8af/564e5f7e34eb52e880256cec0064759f?OpenDocument