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

Images loaded through LoadImageFromUrl are replaced with blanks

5 Answers 142 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Maksym
Top achievements
Rank 1
Maksym asked on 22 Apr 2011, 12:22 PM
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 ?

5 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 27 Apr 2011, 03:00 PM
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
0
Maksym
Top achievements
Rank 1
answered on 27 Apr 2011, 03:40 PM
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.
0
Mike
Telerik team
answered on 03 May 2011, 07:11 AM
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
0
Ludovic Gerbault
Top achievements
Rank 1
answered on 29 Nov 2011, 09:26 AM
Any update on this issue ?
I'm facing the same problem in Q3 2011 (2011.3.1116.1040)
0
Boby
Telerik team
answered on 02 Dec 2011, 12:31 PM
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 >>

Tags
RichTextBox
Asked by
Maksym
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Maksym
Top achievements
Rank 1
Mike
Telerik team
Ludovic Gerbault
Top achievements
Rank 1
Boby
Telerik team
Share this question
or