1

I samples of FlowDocument in C# show images pointing to a location on disk in the xaml file. If I want to point source to image inside program as resource or how do i set the source setting then? I ship my program flowdocument as part of the program and I cant install images on disk. I want them as resource inside the program.

  <InlineUIContainer >
      <Image Margin="2,0" Width="50" Source="C:\sample.jpg" ></Image>
  </InlineUIContainer>
  • Is this what you're looking for? https://stackoverflow.com/questions/25557891/xaml-wpf-how-to-add-inline-background-image-on-flowdocument – dbc Feb 13 '15 at 08:18

1 Answers1

0

You should set image's Build action to Resource and use following code:

    <InlineUIContainer >
        <Image Margin="2,0" Width="50" Source="pack://application:,,,/YourAssemblyName;Images/sample.jpg"></Image>
    </InlineUIContainer>

sample.jpg must be in folder "Images" in your project in this example.

Yuri Dorokhov
  • 716
  • 5
  • 24