Search code examples
c#.netwpfvisual-studioflowdocument

How to adjust a FlowDocuments fontsize relative to its container?


I have a FlowDocument inside a FlowDocumentScrollViewer. The size of the container changes. So does the size of images in the FlowDocument:

<Paragraph>
    <Image Source="/InnovationsforumInfoterminal;component/res/wohnzimmer.jpg"></Image>-->
</Paragraph>

The text-size however always stays the same:

<Paragraph FontFamily="Arial">
    Die beiden wichtigsten ...
</Paragraph>

I want the whole document to scale with the container (so the displayed text, images always look the same).


Solution

  • Your image is set to strech... try changing the image as follows:

    <Paragraph>    
       <Image 
           Source="/InnovationsforumInfoterminal;component/res/wohnzimmer.jpg"
           Strecth="None">
       </Image>
    </Paragraph>