Images loaded through LoadImageFromUrl are replaced with blanks

6 posts, 0 answers
  1. Maksym
    Maksym avatar
    7 posts
    Member since:
    Apr 2011

    Posted 22 Apr 2011 Link to this post

    Hi,
    I want to load some images customly when I import HTML into RadRichTextBox.
    So I subscribed to LoadImageFromUrl like this:
    void ImportSettings_LoadImageFromUrl(object sender, LoadImageEventArgs e)
    {
        var uri = new Uri("/RichTextBoxTestApp;component/Images/" + e.Url, UriKind.Relative);
        string extension = GetExtensionFromURL(e.Url);
        StreamResourceInfo sr = Application.GetResourceStream(uri);                       
        e.ImageElement.Init(sr.Stream, extension);
    }
    but the behavior is that image is shown for split-second and than replaced with blank (probably when RichTextBox loads empty image from e.Url)

    Any workarounds ? maybe to wait after the blank image is loaded from e.Url and after that assign my image to e.ImageElement ?

    Also, how can i upload a small repro solution here ?
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 27 Apr 2011 Link to this post

    Hi Maksym,

    Thank you for bringing this issue to our attention. You are right, the problem seems to be in the order in which the operations are performed. We will fix this issue on our end, but unfortunately, there is no workaround with the current version of the control.
    In appreciation of your bug report, we have updated the Telerik points in your account.

    Regards,
    Iva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Maksym
    Maksym avatar
    7 posts
    Member since:
    Apr 2011

    Posted 27 Apr 2011 Link to this post

    Hi again,

    Well, actually I managed to make it work by preprocessing html and replacing image sources with inline base64 encoded image streams.
    But that's not an easy workaround, and using LoadImageFromUrl event would have been much easier.

    Thanks.
  5. Mike
    Admin
    Mike avatar
    640 posts

    Posted 03 May 2011 Link to this post

    Hi Maksym,

    Thank you for letting us know about this solution, we are glad you found one.
    Hopefully the issue will be fixed in the next release and you would no longer need this workaround.
    In the meanwhile let us know if anything else pops up.

    All the best,
    Mike
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 29 Nov 2011 Link to this post

    Any update on this issue ?
    I'm facing the same problem in Q3 2011 (2011.3.1116.1040)
  7. Boby
    Admin
    Boby avatar
    595 posts

    Posted 02 Dec 2011 Link to this post

    Hello Subileau Pascal,
    This task now has high priority for us and we will do our best to complete it by SP1 which should be out in several weeks. Unfortunately there is no other workaround except the one proposed by Maksym Pushkin. You can track the issue progress in our public issue tracking system here.
    Please, excuse us for the inconvenience. Don't hesitate to contact us if you have other questions.

    Regards,
    Boby
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner