Anyone know how to adding 2 images in the header , one on the left and one on the right?
I try setting defaultHeaderParagraph.Properties.TextAlignment.LocalValue = Alignme
nt.Justified; but it does not work
.
both images still align to left.
Thanks in advance.
1 Answer, 1 is accepted
1
Accepted
Dimitar
Telerik team
answered on 04 Nov 2021, 12:04 PM
Hello Jimmy,
You need to use FloatingImage. Here is an example of this:
var image_Stream = new MemoryStream(File.ReadAllBytes(@"..\..\tick.png"));
var document = new RadFlowDocument();
var header = document.Sections.AddSection().Headers.Add();
var paragraph = header.Blocks.AddParagraph();
var floatingImage1 = paragraph.Inlines.AddFloatingImage();
var floatingImage2 = paragraph.Inlines.AddFloatingImage();
floatingImage1.Image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(image_Stream, "png");
floatingImage2.Image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(image_Stream, "png");
floatingImage1.Image.Size = new Size(100, 100);
floatingImage2.Image.Size = new Size(100, 100);
floatingImage2.HorizontalPosition.Alignment = Telerik.Windows.Documents.Flow.Model.Shapes.RelativeHorizontalAlignment.Right;
floatingImage2.HorizontalPosition.ValueType = Telerik.Windows.Documents.Flow.Model.Shapes.PositionValueType.Alignment;
I hope this helps. Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.