I just know I must save the images in a temp folder and then use them on Htmlviewer .
But suppose we have an email which contains 5 pictures, so html viewer provides 5 empty frames for the images , some of them are located before the text body, some of them are at the middle and some at the end of the email body . Now How can I define which frame should contain which picture ! ? and how to insert them to the Html viewer ?!.
(is there any way to do all job in a memory stream ? I mean without saving the images in a folder )
The benefit to using
THtmlVieweris that you do not need to save the images to file beforehand. The component can request the image data from you when needed, via theOnImageRequestevent. You can supply the data from any source you have available. HTML emails usecid:URLs to refer to resources inside the email itself, usually attachments. When the component asks you for such a URL, you can pull the coresponding data fromTIdMessagedirectly.TIdMessagesupports loading emails completely into memory without using any temp files at all. You do that by creating an instance of theTIdAttachmentMemoryclass in theTIdMessage.OnCreateAttachmentevent.PBear released
THtmlViewerinto the public domain a few years ago and it is now being maintained as an open source project on Google Code. There are several demos available, include a couple that use Indy 9. You should be able to update them to Indy 10, which is what XE2 uses.