WinUI3 : How to exclude particular area in RichTextBlock for text to appear

Harshithraj1871 1,516 Reputation points
2023-05-04T11:47:40.59+00:00

Hi

I am working on the WinUI3 desktop application in C++, I wanted to add an image/ widget on top of a big paragraph like this, and the paragraph contents will wrap around the image accordingly to the visible area.

image

I tried adding a Border with height and Width to an InlineUIController and adding the InlineUIController to the paragraph in RichTextBlock, thinking that the border with an empty area acts as an exclusion area which the text will wrap around. But the border with height and with increased the height of the line like this

User's image

So when we place the image/Widget/container on top of the RichTextBlock, is there any way where we can exclude that particular area so that, the text which should have been below the area of the overlapped image/Widget/container will come on the next visible area? is there any way to do this?

Thank you

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
738 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 82,406 Reputation points
    2023-05-05T14:15:53.9133333+00:00

    You can use instead a WebView2 control (with shape-outside to wrap text around images) :

    Test :User's image

    1 person found this answer helpful.