This is a migrated thread and some comments may be shown as answers.

when I bind the email (html email body of the exchange server) to the richtextbox, I'm unable to show the ebedded images

1 Answer 94 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Srinivasa
Top achievements
Rank 1
Srinivasa asked on 27 Jan 2011, 06:46 AM
image tag in the html email body is as follows
<img width=634 height=478 id="Picture_x0020_1" src="cid:image001.png@01CBAF8A.44238FC0">
but the richtextbox expecting the following the way represent the embedded images.
<img width="272" height="185" src="data:image/png;base64,iVBORw0KGgoAAAANS..." />
can you please help me in this regard.

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 27 Jan 2011, 03:46 PM
Hi Srinivasa,

Html format provider can be customized such as you can handle an event each time an image should be loaded from URL. Here is some code that demonstrates the approach:

HtmlFormatProvider provider = new HtmlFormatProvider();
var myHtmlImportsettings = new HtmlImportSettings();
myHtmlImportsettings.LoadImageFromUrl += new EventHandler<LoadImageEventArgs>(myHtmlImportsettings_LoadImageFromUrl);
provider.ImportSettings = myHtmlImportsettings;
 
void myHtmlImportsettings_LoadImageFromUrl(object sender, LoadImageEventArgs e)
{
    //Get stream from e.Url here:
    e.Url
    //then load the image with the appropriate extension
    e.ImageElement.Init(inputStream, "png");
}

The problem in your case would be to get the image from the Exchange server. You may try doing this via Silverlight WebClient and a separate web-service that would provide the images given the exchange image url. Unfortunately we do not have any experience with such a task.

All the best,
Mike
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
RichTextBox
Asked by
Srinivasa
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or