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

2 posts, 0 answers
  1. Srinivasa
    Srinivasa avatar
    1 posts
    Member since:
    Sep 2010

    Posted 27 Jan 2011 Link to this post

    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.

  2. Mike
    Admin
    Mike avatar
    640 posts

    Posted 27 Jan 2011 Link to this post

    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>>
Back to Top