|
editor.HtmlText = editor.HtmlText + "<p><img src='https://cajapp.com/cajapplogo.png'/></p>" + editor.HtmlText;
|
SfRichTextEditor using the ImageInsertCommand property or the ImageInserted event. Kindly try the below code snippet in which you can load the image from URL with desired position. |
private void RTE1_ImageInserted(object sender, Syncfusion.XForms.RichTextEditor.ImageInsertedEventArgs e)
{
Syncfusion.XForms.RichTextEditor.ImageSource imgSrc = new Syncfusion.XForms.RichTextEditor.ImageSource();
Assembly assembly = typeof(MainPage).GetTypeInfo().Assembly;
//Load Image from application with embedded resource.
Stream image = assembly.GetManifestResourceStream("ImageRTE.1mb.png");
imgSrc.ImageStream = image;
imgSrc.SaveOption = ImageSaveOption.Base64;
RTE1.InsertImage(imgSrc);
//Load Image from URL
var webClient = new WebClient();
MemoryStream stream = new MemoryStream(imageBytes);
stream.Position = 0;
imgSrc.ImageStream = stream;
imgSrc.SaveOption = ImageSaveOption.Base64;
RTE1.InsertImage(imgSrc);
} |