Ok, got it work with RichView.OnImportPicture.
But it seems OnImportPicture fires twice for the same picture. Why?
Paste HTML using pBear HtmlImport
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
In the current implementation, images are loaded sequentially, one by one.
When the parser encounters an image, it invokes the event for loading this picture, and waits while you load/download the picture in this event, then inserts it in TRichView.
However, you can implement threaded loading. But you need to do it yourself.
In OnImportPicture, you need to return a placeholder (some temporal picture) and create a thread for downloading. When the picture is downloaded, replace this placeholder to the downloaded picture.
A couple years ago I created a demo for TrvHtmlImporter: http://trichview.com/resources/html/rvh ... hreads.zip
You can use it as a base for your code.
When the parser encounters an image, it invokes the event for loading this picture, and waits while you load/download the picture in this event, then inserts it in TRichView.
However, you can implement threaded loading. But you need to do it yourself.
In OnImportPicture, you need to return a placeholder (some temporal picture) and create a thread for downloading. When the picture is downloaded, replace this placeholder to the downloaded picture.
A couple years ago I created a demo for TrvHtmlImporter: http://trichview.com/resources/html/rvh ... hreads.zip
You can use it as a base for your code.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: