Unplanned
Last Updated: 06 Mar 2019 12:39 by ADMIN
Naval
Created on: 06 Mar 2019 12:23
Category: RichTextBox
Type: Bug Report
2
RichTextBox: Image (<img>) that doesn't have 'width'/'height' attributes set to it is not rendered with its real size when importing from HTML
When importing an image, defined with a Base64 string which doesn't have its size explicitly set, it is rendered with ImageInline.DefaultImageSize instead of using its real size.

Workaround: Check the size defined in the ImageSource:
var image = this.radRichTextBox.Document.EnumerateChildrenOfType<ImageInline>().First();
if (image.Height == 10 && image.ImageSource.DecodePixelHeight == 0)
{
    image.Height = image.ImageSource.Height;
}
0 comments