WPF Image control not showing resource image

I created a new solution with the updated WPF template sample in MIPSDK 2017 R3 but I’m unable to simply display a image from a embedded resource, what am I doing wrong?

For the record, I’m very unexperienced with WPF since I’ve worked mostly in Winforms.

*Image*->Build Action-> Resource

(Not Embedded Resource)

I have the same issue, I’ve tried several build actions (Resource / content (copy always / if newer) / embedded resource), but no image is shown. I even tried to set the image source to a bitmapimage from relative uri in the constructor of the viewitemwpfusercontrol but still no image is shown.

I’m also struggling with correctly setting the grids background. I’m used to winforms development but since the rendering of winforms is really dramatic and also the fact that winforms support is going to end, I’m starting to get to know wpf.

This only happens when creating a mip plugin though, creating a standalone wpf application there’s no issue at all.

If I understand you correctly, you are not able to display an image on a grid.

Here’s one way showing how to do this:

   <Grid.Background>

       <ImageBrush ImageSource="/YourProjectDLL;component/Subfolder/YourImageFile"/>

   </Grid.Background>

And choose build action either Resource or Content.

I am able to set background image for the grid, I just wasn’t able to add an Image (control) to the grid and load an image into the control. However, after retrying without changes in the xaml, the image was shown, so problem solved :smiley:

[xaml]

    <Grid.Background>

        <ImageBrush ImageSource="/WpfPluginTester;component/Media/Plugin\_Background\_compressed.jpg"/>

    </Grid.Background>

    <Image HorizontalAlignment="Left" Height="411" Grid.RowSpan="2" VerticalAlignment="Center" Width="84" Margin="25,130,0,0" Source="/WpfPluginTester;component/Media/MenC\_Logo\_New\_90CCW.png"/>

</Grid>