Embedding an image in an RTF control

  • Thread starter Thread starter Jason Sobell
  • Start date Start date
J

Jason Sobell

I'm trying to embed an image in an RTF control, but the only working method
I can find is to do so via the clipboard and use myRTF.paste().
The problem here is that it obviously destroys the existing clipboard
contents.
Does anyone know if there is a way to call the RTF control directly (such
as via API calls) and pass it the object to be inserted, or does anyone
have any other suggestions?

Cheers,
Jason
 
Hello,

Jason Sobell said:
I'm trying to embed an image in an RTF control, but the only working method
I can find is to do so via the clipboard and use myRTF.paste().
The problem here is that it obviously destroys the existing clipboard
contents.
Does anyone know if there is a way to call the RTF control directly (such
as via API calls) and pass it the object to be inserted, or does anyone
have any other suggestions?

You can try to save the clipboard content, then insert the image and restore
the clipboard content.

Regards,
Herfried K. Wagner
 
Hello,



You can try to save the clipboard content, then insert the image and restore
the clipboard content.

Regards,
Herfried K. Wagner

Have you tried doing this? There is no clone methods, so it would probably
involve iterating through the data types etc. Very messy and possibly very
memory intensive because you have no idea what is in the clipboard.
Also, I'm not sure if it's even possible given that the clipboard contents
belong to the application that generated them so that the clipboard can be
cleared when the app exits, so it's not a very good solution.

Any other suggestions? Has anyone tried talking to the RTF control through
API calls?

Cheers,
Jason
 
Back
Top